[education/rkward] rkward/rbackend: Fix some backend deadlocks during exit.

Thomas Friedrichsmeier null at kde.org
Sat Aug 6 11:53:42 BST 2022


Git commit c8ed5adbc7a14b5a97121a92db01030d24f6e479 by Thomas Friedrichsmeier.
Committed on 06/08/2022 at 10:53.
Pushed by tfry into branch 'master'.

Fix some backend deadlocks during exit.

M  +1    -0    rkward/rbackend/rkbackendtransmitter.cpp
M  +1    -0    rkward/rbackend/rkrbackend.cpp

https://invent.kde.org/education/rkward/commit/c8ed5adbc7a14b5a97121a92db01030d24f6e479

diff --git a/rkward/rbackend/rkbackendtransmitter.cpp b/rkward/rbackend/rkbackendtransmitter.cpp
index 3856e373..d83e20de 100644
--- a/rkward/rbackend/rkbackendtransmitter.cpp
+++ b/rkward/rbackend/rkbackendtransmitter.cpp
@@ -159,6 +159,7 @@ void RKRBackendTransmitter::handleTransmissionError (const QString &message) {
 	RK_TRACE (RBACKEND);
 
 	if (!connection) return;  // regular exit, or we did not even get to the point of setting up the connection.
+	if (RKRBackend::this_pointer->isKilled()) return;
 	RK_DEBUG (RBACKEND, DL_ERROR, "%s", qPrintable ("Transmission error " + message));
 	RKRBackend::tryToDoEmergencySave ();
 }
diff --git a/rkward/rbackend/rkrbackend.cpp b/rkward/rbackend/rkrbackend.cpp
index 8d3d83c4..ebca3016 100644
--- a/rkward/rbackend/rkrbackend.cpp
+++ b/rkward/rbackend/rkrbackend.cpp
@@ -418,6 +418,7 @@ int RReadConsoleWin (const char* prompt, char* buf, int buflen, int hist) {
 
 bool RKRBackend::fetchStdoutStderr (bool forcibly) {
 #ifndef Q_OS_WIN
+	if (killed) return false;
 	if (!forcibly) {
 		if (!stdout_stderr_mutex.tryLock ()) return false;
 	} else {


More information about the rkward-tracker mailing list