]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/appcmn.cpp
updated copyright year, s/wxWindows/wxWidgets/
[wxWidgets.git] / src / common / appcmn.cpp
index 747e7e2ecdcee8f21f316742f156b07786e9fd62..fb02e6b93dd076cc69d0597fb572fbfd02b1c7f0 100644 (file)
 
 #ifndef WX_PRECOMP
     #include "wx/app.h"
+    #include "wx/window.h"
     #include "wx/bitmap.h"
-    #include "wx/intl.h"
-    #include "wx/list.h"
     #include "wx/log.h"
     #include "wx/msgdlg.h"
-    #include "wx/bitmap.h"
     #include "wx/confbase.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/apptrait.h"
@@ -40,7 +39,7 @@
 #include "wx/evtloop.h"
 #include "wx/msgout.h"
 #include "wx/thread.h"
-#include "wx/utils.h"
+#include "wx/vidmode.h"
 #include "wx/ptr_scpd.h"
 
 #if defined(__WXMSW__)
@@ -55,6 +54,7 @@
 #include "wx/build.h"
 WX_CHECK_BUILD_OPTIONS("wxCore")
 
+WXDLLIMPEXP_DATA_CORE(wxList) wxPendingDelete;
 
 // ----------------------------------------------------------------------------
 // wxEventLoopPtr
@@ -104,7 +104,6 @@ bool wxAppBase::Initialize(int& argcOrig, wxChar **argvOrig)
 #endif
 
     wxInitializeStockLists();
-    wxInitializeStockObjects();
 
     wxBitmap::InitStandardHandlers();
 
@@ -137,7 +136,7 @@ void wxAppBase::CleanUp()
     // undo everything we did in Initialize() above
     wxBitmap::CleanUpHandlers();
 
-    wxDeleteStockObjects();
+    wxStockGDI::DeleteAll();
 
     wxDeleteStockLists();
 
@@ -158,6 +157,21 @@ void wxAppBase::CleanUp()
 #endif // wxUSE_THREADS
 }
 
+// ----------------------------------------------------------------------------
+
+wxWindow* wxAppBase::GetTopWindow() const
+{
+    wxWindow* window = m_topWindow;
+    if (window == NULL && wxTopLevelWindows.GetCount() > 0)
+        window = wxTopLevelWindows.GetFirst()->GetData();
+    return window;
+}
+
+wxVideoMode wxAppBase::GetDisplayMode() const
+{
+    return wxVideoMode();
+}
+
 #if wxUSE_CMDLINE_PARSER
 
 // ----------------------------------------------------------------------------
@@ -367,11 +381,14 @@ void wxAppBase::DeletePendingObjects()
     {
         wxObject *obj = node->GetData();
 
-        delete obj;
-
-        if (wxPendingDelete.Member(obj))
+        // remove it from the list first so that if we get back here somehow
+        // during the object deletion (e.g. wxYield called from its dtor) we
+        // wouldn't try to delete it the second time
+        if ( wxPendingDelete.Member(obj) )
             wxPendingDelete.Erase(node);
 
+        delete obj;
+
         // Deleting one object may have deleted other pending
         // objects, so start from beginning of list again.
         node = wxPendingDelete.GetFirst();