From f7cf8da78e98fb2d7398683419a37ed65be590be Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 21 Jun 2007 12:34:32 +0000 Subject: [PATCH] Added DetachOldLog to avoid destruction of old log target git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@46579 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/log.tex | 7 +++++++ include/wx/log.h | 5 +++++ 2 files changed, 12 insertions(+) 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);