- Update .pro file
authorunc0rr
Mon, 06 Nov 2017 22:26:54 +0100
changeset 12829 c75781937859
parent 12828 e2e372449c19
child 12830 b986a8b8cd56
- Update .pro file - Rethink logic of TCPBase, fixes bug with failing to receive all bytes from engine when process end signal is received before tcp disconnect
QTfrontend/net/tcpBase.cpp
QTfrontend/ui/widget/MinesTimeSpinBox.h
project_files/hedgewars.pro
--- 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()
--- a/QTfrontend/ui/widget/MinesTimeSpinBox.h	Fri Nov 03 13:40:30 2017 +0100
+++ b/QTfrontend/ui/widget/MinesTimeSpinBox.h	Mon Nov 06 22:26:54 2017 +0100
@@ -44,7 +44,7 @@
 
     protected:
         /**
-         * Returns it's value localized.
+         * Returns its value localized.
          * @param value integer value to be representing as string.
          * @return string representation
          */
--- a/project_files/hedgewars.pro	Fri Nov 03 13:40:30 2017 +0100
+++ b/project_files/hedgewars.pro	Mon Nov 06 22:26:54 2017 +0100
@@ -117,6 +117,7 @@
     ../QTfrontend/servermessages.h \
     ../QTfrontend/ui/widget/roomnameprompt.h \
     ../QTfrontend/weapons.h \
+    ../QTfrontend/ui/widget/MinesTimeSpinBox.h \
     ../QTfrontend/net/hwmapoptimizer.h
 
 
@@ -216,6 +217,7 @@
     ../QTfrontend/ui/widget/feedbackdialog.cpp \
     ../QTfrontend/ui/widget/lineeditcursor.cpp \
     ../QTfrontend/ui/widget/roomnameprompt.cpp \
+    ../QTfrontend/ui/widget/MinesTimeSpinBox.cpp \
     ../QTfrontend/net/hwmapoptimizer.cpp