diff --git a/docs/latex/wx/log.tex b/docs/latex/wx/log.tex index 04e2889690..92632f68af 100644 --- a/docs/latex/wx/log.tex +++ b/docs/latex/wx/log.tex @@ -434,6 +434,13 @@ target but the log messages are also passed to the previous log target if any. Destroys the previous log target. +\membersection{wxLogChain::DetachOldLog}\label{wxlogchaindetacholdlog} + +\func{void}{DetachOldLog}{\void} + +Detaches the old log target so it won't be destroyed when the wxLogChain object +is destroyed. + \membersection{wxLogChain::GetOldLog}\label{wxlogchaingetoldlog} \constfunc{wxLog *}{GetOldLog}{\void} diff --git a/include/wx/log.h b/include/wx/log.h index 164bdfca90..00d2e85a4d 100644 --- a/include/wx/log.h +++ b/include/wx/log.h @@ -415,6 +415,11 @@ public: // override base class version to flush the old logger as well virtual void Flush(); + // call to avoid destroying the old log target +#if wxABI_VERSION >= 20805 /* 2.8.5+ only */ + void DetachOldLog() { m_logOld = NULL; } +#endif + protected: // pass the chain to the old logger if needed virtual void DoLog(wxLogLevel level, const wxChar *szString, time_t t);