From: Robin Dunn Date: Tue, 8 Nov 2011 17:40:28 +0000 (+0000) Subject: Ensure that there is a modal event loop before trying to use it. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/85fb0a0afd09f98e5a592db87a100a6332f067c6 Ensure that there is a modal event loop before trying to use it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69704 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/osx/cocoa/evtloop.mm b/src/osx/cocoa/evtloop.mm index 12e98beac0..3a8568b33d 100644 --- a/src/osx/cocoa/evtloop.mm +++ b/src/osx/cocoa/evtloop.mm @@ -421,7 +421,8 @@ void wxWindowDisabler::DoDisable(wxWindow *winToSkip) } m_modalEventLoop = (wxEventLoop*)wxEventLoopBase::GetActive(); - m_modalEventLoop->BeginModalSession(winToSkip); + if (m_modalEventLoop) + m_modalEventLoop->BeginModalSession(winToSkip); } wxWindowDisabler::~wxWindowDisabler() @@ -429,7 +430,8 @@ wxWindowDisabler::~wxWindowDisabler() if ( !m_disabled ) return; - m_modalEventLoop->EndModalSession(); + if (m_modalEventLoop) + m_modalEventLoop->EndModalSession(); wxWindowList::compatibility_iterator node; for ( node = wxTopLevelWindows.GetFirst(); node; node = node->GetNext() )