check memory leaks sooner, when wxLog target is still available
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22628 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -339,6 +339,16 @@ static void DoCommonPostCleanup()
|
|||||||
FreeConvertedArgs();
|
FreeConvertedArgs();
|
||||||
#endif // wxUSE_UNICODE
|
#endif // wxUSE_UNICODE
|
||||||
|
|
||||||
|
// check for memory leaks
|
||||||
|
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
|
||||||
|
if (wxDebugContext::CountObjectsLeft(TRUE) > 0)
|
||||||
|
{
|
||||||
|
wxLogDebug(wxT("There were memory leaks.\n"));
|
||||||
|
wxDebugContext::Dump();
|
||||||
|
wxDebugContext::PrintStatistics();
|
||||||
|
}
|
||||||
|
#endif // Debug
|
||||||
|
|
||||||
#if wxUSE_LOG
|
#if wxUSE_LOG
|
||||||
// and now delete the last logger as well
|
// and now delete the last logger as well
|
||||||
delete wxLog::SetActiveTarget(NULL);
|
delete wxLog::SetActiveTarget(NULL);
|
||||||
@@ -361,17 +371,6 @@ void wxEntryCleanup()
|
|||||||
|
|
||||||
|
|
||||||
DoCommonPostCleanup();
|
DoCommonPostCleanup();
|
||||||
|
|
||||||
// check for memory leaks
|
|
||||||
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
|
|
||||||
if (wxDebugContext::CountObjectsLeft(TRUE) > 0)
|
|
||||||
{
|
|
||||||
wxLogDebug(wxT("There were memory leaks.\n"));
|
|
||||||
wxDebugContext::Dump();
|
|
||||||
wxDebugContext::PrintStatistics();
|
|
||||||
}
|
|
||||||
#endif // Debug
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user