From a16e51b56ac3c46af2f2f7630c8e71b30c2b374d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 30 Oct 2010 23:50:28 +0000 Subject: [PATCH] Restore the old logger in wxLogChain dtor instead of deleting it. wxLogChain was leaving the global log target pointing to a deleted object, resulting in crashes when using wxLogWindow without any explicit SetActiveTarget() calls. Restore the original logger as the active target in wxLogChain dtor to ensure that the active log target remains valid. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65956 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/log.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/log.cpp b/src/common/log.cpp index 88e715f800..dd0f26e1d6 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -852,7 +852,7 @@ wxLogChain::wxLogChain(wxLog *logger) wxLogChain::~wxLogChain() { - delete m_logOld; + wxLog::SetActiveTarget(m_logOld); if ( m_logNew != this ) delete m_logNew; -- 2.45.2