memory leak fixed (tanks unC0Rr)
authordisplacer
Sun, 04 Feb 2007 21:30:23 +0000
changeset 390 dca6bd77d71d
parent 389 9628e69b609f
child 391 e7565bb852a2
memory leak fixed (tanks unC0Rr)
QTfrontend/tcpBase.cpp
--- a/QTfrontend/tcpBase.cpp	Sun Feb 04 20:48:11 2007 +0000
+++ b/QTfrontend/tcpBase.cpp	Sun Feb 04 21:30:23 2007 +0000
@@ -33,7 +33,7 @@
   IPCSocket(0)
 {
   if(!IPCServer) {
-    IPCServer = new QTcpServer(this);
+    IPCServer = new QTcpServer(0);
     IPCServer->setMaxPendingConnections(1);
     if (!IPCServer->listen(QHostAddress::LocalHost)) {
       QMessageBox::critical(0, tr("Error"),
@@ -80,6 +80,7 @@
 
   if(srvsList.size()==1) srvsList.pop_front();
   emit isReadyNow();
+  deleteLater();
 }
 
 void TCPBase::ClientRead()
@@ -97,8 +98,7 @@
 
 void TCPBase::tcpServerReady()
 {
-  disconnect(srvsList.front(), SIGNAL(isReadyNow()), this, SLOT(tcpServerReady()));
-  srvsList.pop_front();
+  disconnect(srvsList.takeFirst(), SIGNAL(isReadyNow()), this, SLOT(tcpServerReady()));
 
   RealStart();
 }