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
This commit is contained in:
Vadim Zeitlin
2010-10-30 23:50:28 +00:00
parent 3120eccfe2
commit a16e51b56a

View File

@@ -852,7 +852,7 @@ wxLogChain::wxLogChain(wxLog *logger)
wxLogChain::~wxLogChain()
{
delete m_logOld;
wxLog::SetActiveTarget(m_logOld);
if ( m_logNew != this )
delete m_logNew;