[rkward/frameworks] rkward/rbackend: Don't crash on problems starting connection
Thomas Friedrichsmeier
thomas.friedrichsmeier at ruhr-uni-bochum.de
Sat Feb 27 13:27:51 UTC 2016
Git commit 50f62c145035720e2e7f414c3bfa30707e056a54 by Thomas Friedrichsmeier.
Committed on 27/02/2016 at 13:27.
Pushed by tfry into branch 'frameworks'.
Don't crash on problems starting connection
M +1 -4 rkward/rbackend/rkfrontendtransmitter.cpp
http://commits.kde.org/rkward/50f62c145035720e2e7f414c3bfa30707e056a54
diff --git a/rkward/rbackend/rkfrontendtransmitter.cpp b/rkward/rbackend/rkfrontendtransmitter.cpp
index 6e9eb94..e8eeb5d 100644
--- a/rkward/rbackend/rkfrontendtransmitter.cpp
+++ b/rkward/rbackend/rkfrontendtransmitter.cpp
@@ -147,9 +147,6 @@ void RKFrontendTransmitter::connectAndEnterLoop () {
QLocalSocket *con = server->nextPendingConnection ();
server->close ();
- // NOTE: Not the same as setConnection(), below, but needed in case of transmission errors.
- connection = con;
-
// handshake
if (!con->canReadLine ()) con->waitForReadyRead (1000);
QString token_c = QString::fromLocal8Bit (con->readLine ());
@@ -208,7 +205,7 @@ void RKFrontendTransmitter::writeRequest (RBackendRequest *request) {
void RKFrontendTransmitter::handleTransmissionError (const QString &message) {
RK_TRACE (RBACKEND);
- connection->close ();
+ if (connection) 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