X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6a0e4ead1ecaba0eda898b0d80a7002654ec4baa..2c544b402610082d2a6193c5e7a364cbfb515942:/src/osx/toplevel_osx.cpp?ds=inline 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; }