[rkward-cvs] SF.net SVN: rkward:[3883] trunk/rkward/rkward/rbackend/rkrbackend.cpp

tfry at users.sourceforge.net tfry at users.sourceforge.net
Tue Oct 4 17:20:22 UTC 2011


Revision: 3883
          http://rkward.svn.sourceforge.net/rkward/?rev=3883&view=rev
Author:   tfry
Date:     2011-10-04 17:20:21 +0000 (Tue, 04 Oct 2011)
Log Message:
-----------
Make fork()ed child processes yet more independent.

Modified Paths:
--------------
    trunk/rkward/rkward/rbackend/rkrbackend.cpp

Modified: trunk/rkward/rkward/rbackend/rkrbackend.cpp
===================================================================
--- trunk/rkward/rkward/rbackend/rkrbackend.cpp	2011-10-04 15:50:30 UTC (rev 3882)
+++ trunk/rkward/rkward/rbackend/rkrbackend.cpp	2011-10-04 17:20:21 UTC (rev 3883)
@@ -426,6 +426,7 @@
 		}
 	}
 
+	if (RKRBackend::this_pointer->killed == RKRBackend::AlreadyDead) return;	// this check is mostly for fork()ed clients
 	RKRBackend::this_pointer->fetchStdoutStderr (true);
 	RKRBackend::this_pointer->handleOutput (RKRBackend::this_pointer->current_locale_codec->toUnicode (buf, buflen), buflen, type == 0 ? ROutput::Output : ROutput::Warning);
 }
@@ -1065,6 +1066,7 @@
 
 void completeForkChild () {
 	RKRBackendProtocolBackend::instance ()->r_thread_id = QThread::currentThreadId();
+	RKRBackend::this_pointer->killed = RKRBackend::AlreadyDead;	// Not quite accurate, but disables all communication with the frontend
 }
 #endif
 

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the rkward-tracker mailing list