X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f303564dbdcd15b2a7a5da3cc8a6c1fc23f0a93a..cf83f7c6170d8caeda7a3f61ddbd6a822f086002:/src/common/toplvcmn.cpp diff --git a/src/common/toplvcmn.cpp b/src/common/toplvcmn.cpp index 71bc0468d3..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,8 +80,16 @@ bool wxTopLevelWindowBase::Destroy() if ( !wxPendingDelete.Member(this) ) wxPendingDelete.Append(this); - // but hide it immediately - Hide(); + 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; }