X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7fe7d506b191a94ce327c2a18733a4d3bc576cac..a6d57d0388f29fca011b0e168e926b61be0f465c:/samples/memcheck/memcheck.cpp diff --git a/samples/memcheck/memcheck.cpp b/samples/memcheck/memcheck.cpp index ee9b073b48..54712a16f4 100644 --- a/samples/memcheck/memcheck.cpp +++ b/samples/memcheck/memcheck.cpp @@ -25,9 +25,9 @@ #include "wx/wx.h" #endif -#include "wx/date.h" +#include "wx/datetime.h" -#if defined(__WXGTK__) || defined(__WXMOTIF__) +#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) #include "mondrian.xpm" #endif @@ -86,17 +86,27 @@ bool MyApp::OnInit(void) wxDebugContext::SetCheckpoint(); wxString *thing = new wxString; - wxDate* date = new wxDate; + +#if wxUSE_DATETIME + wxDateTime* date = new wxDateTime; +#endif // wxUSE_DATETIME // non-object allocation char *ordinaryNonObject = new char[1000]; 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;