]> git.saurik.com Git - wxWidgets.git/commitdiff
Use wxInitializer in wxEntryReal() instead of directly calling wxEntryStart() without...
authorVáclav Slavík <vslavik@fastmail.fm>
Thu, 30 Jul 2009 07:09:43 +0000 (07:09 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Thu, 30 Jul 2009 07:09:43 +0000 (07:09 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61552 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/init.cpp

index 90afc70ac85f630041fca490e08035857f2e9ebf..dd91413436e2f504b2a11817edacee4a6a21c7cb 100644 (file)
@@ -113,14 +113,6 @@ private:
     wxAppConsole *m_app;
 };
 
-// another tiny class which simply exists to ensure that wxEntryCleanup is
-// always called
-class wxCleanupOnExit
-{
-public:
-    ~wxCleanupOnExit() { wxEntryCleanup(); }
-};
-
 // ----------------------------------------------------------------------------
 // private functions
 // ----------------------------------------------------------------------------
@@ -422,7 +414,9 @@ void wxEntryCleanup()
 int wxEntryReal(int& argc, wxChar **argv)
 {
     // library initialization
-    if ( !wxEntryStart(argc, argv) )
+    wxInitializer initializer(argc, argv);
+
+    if ( !initializer.IsOk() )
     {
 #if wxUSE_LOG
         // flush any log messages explaining why we failed
@@ -431,12 +425,6 @@ int wxEntryReal(int& argc, wxChar **argv)
         return -1;
     }
 
-    // if wxEntryStart succeeded, we must call wxEntryCleanup even if the code
-    // below returns or throws
-    wxCleanupOnExit cleanupOnExit;
-
-    WX_SUPPRESS_UNUSED_WARN(cleanupOnExit);
-
     wxTRY
     {
         // app initialization