X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9c21efe30131c78c25763446e0754e2a0b54dc30..29d83fc1e5d41ef6adb7984127ce5dc013b09815:/src/common/log.cpp diff --git a/src/common/log.cpp b/src/common/log.cpp index 1ec43bfa0a..a60e289df5 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -323,6 +323,16 @@ wxLog *wxLog::SetActiveTarget(wxLog *pLogger) return pOldLogger; } +void wxLog::DontCreateOnDemand() +{ + ms_bAutoCreate = FALSE; + + // this is usually called at the end of the program and we assume that it + // is *always* called at the end - so we free memory here to avoid false + // memory leak reports from wxWin memory tracking code + ClearTraceMasks(); +} + void wxLog::RemoveTraceMask(const wxString& str) { int index = ms_aTraceMasks.Index(str); @@ -330,6 +340,11 @@ void wxLog::RemoveTraceMask(const wxString& str) ms_aTraceMasks.Remove((size_t)index); } +void wxLog::ClearTraceMasks() +{ + ms_aTraceMasks.Clear(); +} + void wxLog::TimeStamp(wxString *str) { if ( ms_timestamp )