]> git.saurik.com Git - wxWidgets.git/commitdiff
Ensure that there is a modal event loop before trying to use it.
authorRobin Dunn <robin@alldunn.com>
Tue, 8 Nov 2011 17:40:28 +0000 (17:40 +0000)
committerRobin Dunn <robin@alldunn.com>
Tue, 8 Nov 2011 17:40:28 +0000 (17:40 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69704 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/cocoa/evtloop.mm

index 12e98beac05d6b48e39f20abc01d89d109fd8dc2..3a8568b33dce0ab4a0442b546093cc6dd33fcbb0 100644 (file)
@@ -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() )