[rkward-cvs] SF.net SVN: rkward: [1707] trunk/rkward/rkward/scriptbackends/phpbackend. cpp

tfry at users.sourceforge.net tfry at users.sourceforge.net
Thu Mar 22 21:42:58 UTC 2007


Revision: 1707
          http://svn.sourceforge.net/rkward/?rev=1707&view=rev
Author:   tfry
Date:     2007-03-22 14:42:58 -0700 (Thu, 22 Mar 2007)

Log Message:
-----------
Fix a crash that occurred under some circumstances, if there is an error in the PHP backend

Modified Paths:
--------------
    trunk/rkward/rkward/scriptbackends/phpbackend.cpp

Modified: trunk/rkward/rkward/scriptbackends/phpbackend.cpp
===================================================================
--- trunk/rkward/rkward/scriptbackends/phpbackend.cpp	2007-03-22 21:29:46 UTC (rev 1706)
+++ trunk/rkward/rkward/scriptbackends/phpbackend.cpp	2007-03-22 21:42:58 UTC (rev 1707)
@@ -312,10 +312,12 @@
 void PHPBackend::processDied (KProcess *) {
 	RK_TRACE (PHP);
 
-	php_process->detach ();
-	KMessageBox::error (0, i18n ("The PHP-backend has died unexpectedly. The current output buffer is shown below:\n%1").arg (output_raw_buffer), i18n ("PHP Process exited"));
-	emit (haveError ());
-	destroy ();
+	if (php_process) {		// if the php_process is already 0, this means, we have caught an error message before the process died, have already shown a message, emitted haveError(), and called destroy()
+		php_process->detach ();
+		KMessageBox::error (0, i18n ("The PHP-backend has died unexpectedly. The current output buffer is shown below:\n%1").arg (output_raw_buffer), i18n ("PHP Process exited"));
+		emit (haveError ());
+		destroy ();
+	}
 }
 
 


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