[rkward-cvs] [rkward] rkward/rbackend: New attempt at fixing the hang on exit: Do not kill the backend process from the transmitter thread at all.

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Mon Jan 12 21:12:48 UTC 2015


Git commit 3fa7111bcc1b26e378fba21a8192c3a08f109660 by Thomas Friedrichsmeier.
Committed on 12/01/2015 at 21:10.
Pushed by tfry into branch 'master'.

New attempt at fixing the hang on exit: Do not kill the backend process from the transmitter thread at all.
It should be perfectly fine to do this via the destructor from the main thread.
Note that the backend's signal for quitting is losing the connection.

M  +1    -4    rkward/rbackend/rkfrontendtransmitter.cpp

http://commits.kde.org/rkward/3fa7111bcc1b26e378fba21a8192c3a08f109660

diff --git a/rkward/rbackend/rkfrontendtransmitter.cpp b/rkward/rbackend/rkfrontendtransmitter.cpp
index 99eab9b..e992de0 100644
--- a/rkward/rbackend/rkfrontendtransmitter.cpp
+++ b/rkward/rbackend/rkfrontendtransmitter.cpp
@@ -122,10 +122,6 @@ void RKFrontendTransmitter::run () {
 		RK_ASSERT (false);
 		return;
 	}
-
-	connection->close ();
-	backend->waitForFinished ();
-	delete backend;	// otherwise it will be deleted via the constructor from the main thread, which can cause hangs.
 }
 
 void RKFrontendTransmitter::connectAndEnterLoop () {
@@ -193,6 +189,7 @@ void RKFrontendTransmitter::writeRequest (RBackendRequest *request) {
 void RKFrontendTransmitter::handleTransmissionError (const QString &message) {
 	RK_TRACE (RBACKEND);
 
+	connection->close ();
 	RBackendRequest* req = new RBackendRequest (false, RBackendRequest::BackendExit);
 	req->params["message"] = message;
 	RKRBackendEvent* event = new RKRBackendEvent (req);





More information about the rkward-tracker mailing list