X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/14f355c2b5c71fc7c3d680aea366582d2ac60f7b..4395fb21f651f8a08905c34507692ca7f902dfe5:/src/common/toplvcmn.cpp?ds=inline diff --git a/src/common/toplvcmn.cpp b/src/common/toplvcmn.cpp index dc1a79b916..aa0d96d70c 100644 --- a/src/common/toplvcmn.cpp +++ b/src/common/toplvcmn.cpp @@ -65,7 +65,7 @@ wxTopLevelWindowBase::~wxTopLevelWindowBase() bool shouldExit = IsLastBeforeExit(); wxTopLevelWindows.DeleteObject(this); - + if ( shouldExit ) { // then do it @@ -80,6 +80,17 @@ bool wxTopLevelWindowBase::Destroy() if ( !wxPendingDelete.Member(this) ) wxPendingDelete.Append(this); + if (wxTopLevelWindows.GetCount() > 1) + { + // Hide it immediately. This should + // not be done if this TLW is the + // only one left since we then would + // risk not to get any idle events + // at all anymore during which we + // could delete any pending events. + Hide(); + } + return TRUE; }