X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4b5f3fe655deeb91d5d3abe8fad30c4a1cae63dc..2a31049201e9c1ff9f515eb9d144ae392f4b4e5a:/src/stubs/app.cpp?ds=sidebyside diff --git a/src/stubs/app.cpp b/src/stubs/app.cpp index aac09eb02c..681e661556 100644 --- a/src/stubs/app.cpp +++ b/src/stubs/app.cpp @@ -40,12 +40,10 @@ extern wxList wxPendingDelete; wxApp *wxTheApp = NULL; -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler) BEGIN_EVENT_TABLE(wxApp, wxEvtHandler) EVT_IDLE(wxApp::OnIdle) END_EVENT_TABLE() -#endif long wxApp::sm_lastMessageTime = 0; @@ -57,13 +55,14 @@ bool wxApp::Initialize() wxBuffer = new char[BUFSIZ + 512]; #endif -#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT +/* No longer used +#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT streambuf* sBuf = new wxDebugStreamBuf; ostream* oStr = new ostream(sBuf) ; wxDebugContext::SetStream(oStr, sBuf); - #endif +*/ wxClassInfo::InitializeClasses(); @@ -119,6 +118,23 @@ void wxApp::CleanUp() wxClassInfo::CleanUpClasses(); + delete wxTheApp; + wxTheApp = NULL; + +#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT + // At this point we want to check if there are any memory + // blocks that aren't part of the wxDebugContext itself, + // as a special case. Then when dumping we need to ignore + // wxDebugContext, too. + if (wxDebugContext::CountObjectsLeft() > 0) + { + wxTrace("There were memory leaks.\n"); + wxDebugContext::Dump(); + wxDebugContext::PrintStatistics(); + } +// wxDebugContext::SetStream(NULL, NULL); +#endif + // do it as the very last thing because everything else can log messages wxLog::DontCreateOnDemand(); // do it as the very last thing because everything else can log messages @@ -174,23 +190,6 @@ int wxEntry( int argc, char *argv[] ) wxApp::CleanUp(); - delete wxTheApp; - wxTheApp = NULL; - -#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT - // At this point we want to check if there are any memory - // blocks that aren't part of the wxDebugContext itself, - // as a special case. Then when dumping we need to ignore - // wxDebugContext, too. - if (wxDebugContext::CountObjectsLeft() > 0) - { - wxTrace("There were memory leaks.\n"); - wxDebugContext::Dump(); - wxDebugContext::PrintStatistics(); - } - wxDebugContext::SetStream(NULL, NULL); -#endif - return retValue; }; @@ -325,7 +324,7 @@ bool wxApp::SendIdleEvents(wxWindow* win) if (event.MoreRequested()) needMore = TRUE; - wxNode* node = win->GetChildren()->First(); + wxNode* node = win->GetChildren().First(); while (node) { wxWindow* win = (wxWindow*) node->Data();