]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/event.cpp
Mac -> OSX header change.
[wxWidgets.git] / src / common / event.cpp
index 461b6fe5e783ace86af812afe81ab06ebbc988d8..2a4ff7954eb41a67415195d9141421743cbcb563 100644 (file)
@@ -1394,9 +1394,15 @@ bool wxEvtHandler::SafelyProcessEvent(wxEvent& event)
     }
     catch ( ... )
     {
-        wxEventLoopBase *loop = wxEventLoopBase::GetActive();
+        // notice that we do it in 2 steps to avoid warnings about possibly
+        // uninitialized loop variable from some versions of g++ which are not
+        // smart enough to figure out that GetActive() doesn't throw and so
+        // that loop will always be initialized
+        wxEventLoopBase *loop = NULL;
         try
         {
+            loop = wxEventLoopBase::GetActive();
+
             if ( !wxTheApp || !wxTheApp->OnExceptionInMainLoop() )
             {
                 if ( loop )