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
This commit is contained in:
Julian Smart
2007-06-21 12:34:32 +00:00
parent 10aee5e5d4
commit f7cf8da78e
2 changed files with 12 additions and 0 deletions

View File

@@ -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}

View File

@@ -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);