X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7fe7d506b191a94ce327c2a18733a4d3bc576cac..4f3449b43280a855e57280e6848610ea9fdaa3bb:/samples/memcheck/memcheck.cpp diff --git a/samples/memcheck/memcheck.cpp b/samples/memcheck/memcheck.cpp index ee9b073b48..e09ad22ba2 100644 --- a/samples/memcheck/memcheck.cpp +++ b/samples/memcheck/memcheck.cpp @@ -93,10 +93,17 @@ bool MyApp::OnInit(void) const char *data = (const char*) thing ; + // On MSW, Dump() crashes if using wxLogGui, + // so use wxLogStderr instead. + wxLog* oldLog = wxLog::SetActiveTarget(new wxLogStderr); + wxDebugContext::PrintClasses(); wxDebugContext::Dump(); wxDebugContext::PrintStatistics(); + // Set back to wxLogGui + delete wxLog::SetActiveTarget(oldLog); + // Don't delete these objects, to force wxApp to flag a memory leak. // delete thing; // delete date;