]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/init.cpp
Corrected size of staticbox borders when running OS X Panther or higher.
[wxWidgets.git] / src / common / init.cpp
index 774cbd2273c042793491bc2ff680ef9c9c61c52e..39874736bf4ab3c9098f353cde102b19241ce31f 100644 (file)
@@ -403,13 +403,17 @@ int wxEntryReal(int& argc, wxChar **argv)
             return -1;
         }
 
-        // app execution
-        int retValue = wxTheApp->OnRun();
+        // ensure that OnExit() is called if OnInit() had succeeded
+        class CallOnExit
+        {
+        public:
+            ~CallOnExit() { wxTheApp->OnExit(); }
+        } callOnExit;
 
-        // app clean up
-        wxTheApp->OnExit();
+        WX_SUPPRESS_UNUSED_WARN(callOnExit);
 
-        return retValue;
+        // app execution
+        return wxTheApp->OnRun();
     }
     wxCATCH_ALL( wxTheApp->OnUnhandledException(); return -1; )
 }