[education/rkward] rkward/rbackend: Fix new race condition

Thomas Friedrichsmeier null at kde.org
Mon Aug 1 18:51:17 BST 2022


Git commit 44de25dcab46bd271da82d8f3eb078535512bd65 by Thomas Friedrichsmeier.
Committed on 01/08/2022 at 17:51.
Pushed by tfry into branch 'master'.

Fix new race condition

M  +2    -2    rkward/rbackend/rkfrontendtransmitter.cpp

https://invent.kde.org/education/rkward/commit/44de25dcab46bd271da82d8f3eb078535512bd65

diff --git a/rkward/rbackend/rkfrontendtransmitter.cpp b/rkward/rbackend/rkfrontendtransmitter.cpp
index 13a0f939..393948bd 100644
--- a/rkward/rbackend/rkfrontendtransmitter.cpp
+++ b/rkward/rbackend/rkfrontendtransmitter.cpp
@@ -195,8 +195,8 @@ QString RKFrontendTransmitter::waitReadLine (QIODevice* con, int msecs) {
 
 void RKFrontendTransmitter::connectAndEnterLoop () {
 	RK_TRACE(RBACKEND);
-	RK_ASSERT(server->hasPendingConnections());
-	if (token.isEmpty()) return;  // See comment in c'tor
+	if (!server->hasPendingConnections()) return;  // May happen due to race condition
+	if (token.isEmpty()) return;  // See comment in run()
 
 	QLocalSocket *con = server->nextPendingConnection ();
 	server->close ();


More information about the rkward-tracker mailing list