X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6a0e4ead1ecaba0eda898b0d80a7002654ec4baa..64ea838d8f4d1853b7d850db93ee565e901d099a:/src/osx/toplevel_osx.cpp diff --git a/src/osx/toplevel_osx.cpp b/src/osx/toplevel_osx.cpp index b660d8f474..f92665932e 100644 --- a/src/osx/toplevel_osx.cpp +++ b/src/osx/toplevel_osx.cpp @@ -106,7 +106,13 @@ bool wxTopLevelWindowMac::Destroy() if (m_nowpeer && m_nowpeer->GetWXWindow()) ClearKeyboardFocus( (WindowRef)m_nowpeer->GetWXWindow() ); #endif - return wxTopLevelWindowBase::Destroy(); + // delayed destruction: the tlw will be deleted during the next idle + // loop iteration + if ( !wxPendingDelete.Member(this) ) + wxPendingDelete.Append(this); + + Hide(); + return true; }