]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/persist/window.h
build fix
[wxWidgets.git] / include / wx / persist / window.h
index 692e143a139e3f6942322c7e849fdfffd8a148b7..1cb6d012573305ea58be30ea4301c82d7d0cc5f8 100644 (file)
@@ -60,11 +60,16 @@ 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());
+        }
     }
 
-    DECLARE_NO_COPY_CLASS(wxPersistentWindowBase)
+    wxDECLARE_NO_COPY_CLASS(wxPersistentWindowBase);
 };
 
 template <class T>