From: Vadim Zeitlin Date: Sun, 8 Feb 2009 15:20:37 +0000 (+0000) Subject: don't react to wxEVT_DESTROY events from child windows X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/f61ea9468f0b70bc86ccf0746c135071a716ee3d don't react to wxEVT_DESTROY events from child windows git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58762 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/persist/window.h b/include/wx/persist/window.h index 01ff6489d1..1cb6d01257 100644 --- a/include/wx/persist/window.h +++ b/include/wx/persist/window.h @@ -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);