]> git.saurik.com Git - wxWidgets.git/commitdiff
don't react to wxEVT_DESTROY events from child windows
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 8 Feb 2009 15:20:37 +0000 (15:20 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 8 Feb 2009 15:20:37 +0000 (15:20 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58762 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/persist/window.h

index 01ff6489d13157119cfc3eebefd3836f1ecb71c3..1cb6d012573305ea58be30ea4301c82d7d0cc5f8 100644 (file)
@@ -60,8 +60,13 @@ private:
     {
         event.Skip();
 
-        // this will delete this object itself
-        wxPersistenceManager::Get().SaveAndUnregister(GetWindow());
+        // only react to the destruction of this object itself, not of any of
+        // its children
+        if ( event.GetEventObject() == GetObject() )
+        {
+            // this will delete this object itself
+            wxPersistenceManager::Get().SaveAndUnregister(GetWindow());
+        }
     }
 
     wxDECLARE_NO_COPY_CLASS(wxPersistentWindowBase);