From 28fcf8f1edce15f624780c5bf7ae6f39dd936678 Mon Sep 17 00:00:00 2001 From: jenslody Date: Sat, 22 Apr 2017 14:25:27 +0000 Subject: * wxSmith-plugin: fix crash, when closing wxs-file and a sub-property is selected; see: http://forums.codeblocks.org/index.php/topic,21893.0.html git-svn-id: https://svn.code.sf.net/p/codeblocks/code/trunk@11053 2a5c6006-c6dd-42ca-98ab-0921f2732cef Version-number in wxCHECK_VERSION modified to make patch work jenslody Mon Apr 24 2017 diff --git a/src/plugins/contrib/wxSmith/properties/wxspropertygridmanager.cpp b/src/plugins/contrib/wxSmith/properties/wxspropertygridmanager.cpp index 87d055d..f37d9d6 100644 --- a/src/plugins/contrib/wxSmith/properties/wxspropertygridmanager.cpp +++ b/src/plugins/contrib/wxSmith/properties/wxspropertygridmanager.cpp @@ -171,6 +171,10 @@ void wxsPropertyGridManager::UnbindPropertyContainer(wxsPropertyContainer* PC, b { if ( PGContainers[i] == PC ) { + // before deleting the property, make sure all children are hidden or we can get a crash + // we do this by recursively hiding the property and it's children + // should fix http://forums.codeblocks.org/index.php/topic,21893.0.html + PGIDs[i]->Hide(true); #if wxCHECK_VERSION(2, 9, 0) || wxCHECK_PROPGRID_VERSION(1, 4, 0) DeleteProperty(PGIDs[i]); #else