From: Stefan Csomor Date: Tue, 12 Jun 2012 23:32:46 +0000 (+0000) Subject: avoiding dangerous redraw events for windows that are on their way out… X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/eebddb377ee7b87ff33a876951c3888a83d3d064 avoiding dangerous redraw events for windows that are on their way out… git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71735 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- 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; }