[PATCH] Patch fixing SIGSEGV on project close in PHP part

Sebastian Gutweiler sebastian at gutweiler.net
Mon Aug 11 17:37:02 UTC 2003


Hi,

this patch fixes a segmentation fault when closing a PHP project. 

The PHPSupportPart destructor called 

delete(m_phpErrorView) and then
mainWindow()->removeView(m_phpErrorView) 

leading to a segmentation fault. 
Strange: This only happened when kdevelop was not in IDEAI-mode. 

This patch should fix this problem. 

Sebastian
-------------- next part --------------
diff -u --recursive --new-file kdevelop_orig/parts/phpsupport/phpsupportpart.cpp kdevelop_change/parts/phpsupport/phpsupportpart.cpp
--- kdevelop_orig/parts/phpsupport/phpsupportpart.cpp	Sat Aug  9 15:12:09 2003
+++ kdevelop_change/parts/phpsupport/phpsupportpart.cpp	Mon Aug 11 17:20:18 2003
@@ -124,8 +124,12 @@
     }
 
     delete( phpExeProc );
-    delete( m_phpErrorView );
-    mainWindow()->removeView( m_phpErrorView );
+
+    if(m_phpErrorView){
+	mainWindow()->removeView( m_phpErrorView );
+    	delete( m_phpErrorView );
+	m_phpErrorView = 0;
+    }
 }
 
 void PHPSupportPart::slotActivePartChanged(KParts::Part *part){


More information about the KDevelop-devel mailing list