From 2ee96a251c9556d4d410a860c211a56834f18c7f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 8 Nov 2005 01:02:48 +0000 Subject: [PATCH] fix memory leak of wxMessageOutput if wxApp::OnInit() returned false git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36119 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/appbase.cpp | 4 ---- src/common/init.cpp | 5 ++++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/common/appbase.cpp b/src/common/appbase.cpp index 35145e1e8f..663e7ea670 100644 --- a/src/common/appbase.cpp +++ b/src/common/appbase.cpp @@ -207,10 +207,6 @@ int wxAppConsole::OnExit() delete wxConfigBase::Set((wxConfigBase *) NULL); #endif // wxUSE_CONFIG - // 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); - return 0; } diff --git a/src/common/init.cpp b/src/common/init.cpp index f6cc91b350..9b87e18152 100644 --- a/src/common/init.cpp +++ b/src/common/init.cpp @@ -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); -- 2.45.2