]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/memcheck/memcheck.cpp
Added regex to WXINC line (patch from Markus G)
[wxWidgets.git] / samples / memcheck / memcheck.cpp
index ee9b073b48f9db0ebad6d4d058327dc991a77b80..e09ad22ba29aa0eea106b6622dce5ad644952bb4 100644 (file)
@@ -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;