]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/appcmn.cpp
Hopefully fixed library names generated by wx-config for OS/2's PM port.
[wxWidgets.git] / src / common / appcmn.cpp
index 335d9ec82b70e4aef4131fc7fcd93da6437d85e7..dddd390ab56bf8192c08b921a46e1e4d46057867 100644 (file)
@@ -48,7 +48,7 @@
 #include "wx/ptr_scpd.h"
 
 #if defined(__WXMSW__)
-  #include  "wx/msw/private.h"  // includes windows.h for LOGFONT
+    #include  "wx/msw/private.h"  // includes windows.h for LOGFONT
 #endif
 
 #if wxUSE_FONTMAP
@@ -128,9 +128,19 @@ wxAppBase::~wxAppBase()
 
 void wxAppBase::CleanUp()
 {
-    // one last chance for pending objects to be cleaned up
+    // clean up all the pending objects
     DeletePendingObjects();
 
+    // and any remaining TLWs (they remove themselves from wxTopLevelWindows
+    // when destroyed, so iterate until none are left)
+    while ( !wxTopLevelWindows.empty() )
+    {
+        // do not use Destroy() here as it only puts the TLW in pending list
+        // but we want to delete them now
+        delete wxTopLevelWindows.GetFirst()->GetData();
+    }
+
+    // undo everything we did in Initialize() above
     wxBitmap::CleanUpHandlers();
 
     wxDeleteStockObjects();
@@ -174,7 +184,7 @@ void wxAppBase::OnInitCmdLine(wxCmdLineParser& parser)
 #ifdef __WXUNIVERSAL__
         {
             wxCMD_LINE_OPTION,
-            _T(""),
+            wxEmptyString,
             OPTION_THEME,
             gettext_noop("specify the theme to use"),
             wxCMD_LINE_VAL_STRING,
@@ -188,7 +198,7 @@ void wxAppBase::OnInitCmdLine(wxCmdLineParser& parser)
         //     and not mgl/app.cpp
         {
             wxCMD_LINE_OPTION,
-            _T(""),
+            wxEmptyString,
             OPTION_MODE,
             gettext_noop("specify display mode to use (e.g. 640x480-16)"),
             wxCMD_LINE_VAL_STRING,
@@ -199,9 +209,9 @@ void wxAppBase::OnInitCmdLine(wxCmdLineParser& parser)
         // terminator
         {
             wxCMD_LINE_NONE,
-            _T(""),
-            _T(""),
-            _T(""),
+            wxEmptyString,
+            wxEmptyString,
+            wxEmptyString,
             wxCMD_LINE_VAL_NONE,
             0x0
         }
@@ -468,7 +478,7 @@ wxLog *wxGUIAppTraitsBase::CreateLogTarget()
 #if wxUSE_LOGGUI
     return new wxLogGui;
 #else
-    // weust have something!
+    // we must have something!
     return new wxLogStderr;
 #endif
 }
@@ -570,10 +580,10 @@ void wxGUIAppTraitsBase::RemoveFromPendingDelete(wxObject *object)
 
 #if wxUSE_SOCKETS
 
-#if defined(__UNIX__) || defined(__DARWIN__) || defined(__OS2__)
-    #include "wx/unix/gsockunx.h"
-#elif defined(__WINDOWS__)
+#if defined(__WINDOWS__)
     #include "wx/msw/gsockmsw.h"
+#elif defined(__UNIX__) || defined(__DARWIN__) || defined(__OS2__)
+    #include "wx/unix/gsockunx.h"
 #elif defined(__WXMAC__)
   #include <MacHeaders.c>
   #define OTUNIXERRORS 1