QTfrontend/net/tcpBase.cpp
changeset 12824 c75781937859
parent 11046 47a8c19ecb60
child 12855 1b2b84315d27
child 12874 7caa4ec513bd
--- a/QTfrontend/net/tcpBase.cpp	Fri Nov 03 13:40:30 2017 +0100
+++ b/QTfrontend/net/tcpBase.cpp	Mon Nov 06 22:26:54 2017 +0100
@@ -190,7 +190,6 @@
 
 void TCPBase::ClientDisconnect()
 {
-    disconnect(IPCSocket, SIGNAL(readyRead()), this, SLOT(ClientRead()));
     onClientDisconnect();
 
     if(!simultaneousRun())
@@ -202,8 +201,11 @@
         emit isReadyNow();
     }
 
-    IPCSocket->deleteLater();
-    IPCSocket = NULL;
+    if(IPCSocket) {
+      disconnect(IPCSocket, SIGNAL(readyRead()), this, SLOT(ClientRead()));
+      IPCSocket->deleteLater();
+      IPCSocket = NULL;
+    }
 
     deleteLater();
 }
@@ -226,7 +228,8 @@
 {
     Q_UNUSED(exitStatus);
 
-    ClientDisconnect();
+    if(!m_connected)
+      ClientDisconnect();
 
     // show error message if there was an error that was not an engine's
     // fatal error - because that one already sent a info via IPC
@@ -242,16 +245,6 @@
             .arg("Feedback"));
 
     }
-
-    // cleanup up
-    if (IPCSocket)
-    {
-        IPCSocket->close();
-        IPCSocket->deleteLater();
-    }
-
-    // plot suicide
-    deleteLater();
 }
 
 void TCPBase::tcpServerReady()