X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d91535c47f8bb17ab9740e35baea3f6450de026d..2245b2b2c3339ecf023e5880caa803610a5d1907:/src/common/log.cpp?ds=inline diff --git a/src/common/log.cpp b/src/common/log.cpp index 420c172a63..93842ef100 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -168,7 +168,7 @@ void wxVLogFatalError(const wxChar *szFormat, va_list argptr) #if wxUSE_GUI wxMessageBox(s_szBuf, _("Fatal Error"), wxID_OK | wxICON_STOP); #else - fprintf(stderr, _("Fatal error: %s\n"), s_szBuf); + wxFprintf(stderr, _("Fatal error: %s\n"), s_szBuf); #endif abort(); @@ -764,16 +764,24 @@ void wxLogStream::DoLogString(const wxChar *szString, time_t WXUNUSED(t)) wxLogChain::wxLogChain(wxLog *logger) { + m_bPassMessages = TRUE; + m_logNew = logger; m_logOld = wxLog::SetActiveTarget(this); } -void wxLogChain::SetLog(wxLog *logger) +wxLogChain::~wxLogChain() { + delete m_logOld; + if ( m_logNew != this ) delete m_logNew; +} - wxLog::SetActiveTarget(logger); +void wxLogChain::SetLog(wxLog *logger) +{ + if ( m_logNew != this ) + delete m_logNew; m_logNew = logger; }