X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/338026503bb5f5826bd9fbea9d2ab51b1ee02beb..b6b59e43ca3972b4b3d30f0e75440870410dc321:/src/common/init.cpp diff --git a/src/common/init.cpp b/src/common/init.cpp index aaeec98204..258539e3ff 100644 --- a/src/common/init.cpp +++ b/src/common/init.cpp @@ -70,8 +70,8 @@ public: // we need a special kind of auto pointer to wxApp which not only deletes the // pointer it holds in its dtor but also resets the global application pointer -wxDECLARE_SCOPED_PTR(wxAppConsole, wxAppPtrBase); -wxDEFINE_SCOPED_PTR(wxAppConsole, wxAppPtrBase); +wxDECLARE_SCOPED_PTR(wxAppConsole, wxAppPtrBase) +wxDEFINE_SCOPED_PTR(wxAppConsole, wxAppPtrBase) class wxAppPtr : public wxAppPtrBase { @@ -364,7 +364,10 @@ static void DoCommonPostCleanup() FreeConvertedArgs(); #endif // wxUSE_UNICODE - // Note: check for memory leaks is now done via wxDebugContextDumpDelayCounter + // use Set(NULL) and not Get() to avoid creating a message output object on + // demand when we just want to delete it + delete wxMessageOutput::Set(NULL); + #if wxUSE_LOG // and now delete the last logger as well delete wxLog::SetActiveTarget(NULL); @@ -474,7 +477,7 @@ void wxUninitialize() { wxCRIT_SECT_LOCKER(lockInit, gs_initData.csInit); - if ( !--gs_initData.nInitCount ) + if ( --gs_initData.nInitCount == 0 ) { wxEntryCleanup(); }