using other leak checkers).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30828
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// Normally, new is automatically defined to be the
// debugging version. If not, this does it.
// Normally, new is automatically defined to be the
// debugging version. If not, this does it.
-#if !defined(new) && defined(WXDEBUG_NEW)
+#if !defined(new) && defined(WXDEBUG_NEW) && wxUSE_DEBUG_CONTEXT
#define new WXDEBUG_NEW
#endif
#define new WXDEBUG_NEW
#endif
// Show the frame
frame->Show(TRUE);
// Show the frame
frame->Show(TRUE);
wxDebugContext::SetCheckpoint();
wxDebugContext::SetCheckpoint();
+#endif
+
+ // object allocation
+ wxBrush* brush = new wxBrush(*wxRED);
+ wxBitmap* bitmap = new wxBitmap(100, 100);
+
+ // non-object allocation
+ char *ordinaryNonObject = new char[1000];
wxString *thing = new wxString;
wxString *thing = new wxString;
wxDateTime* date = new wxDateTime;
#endif // wxUSE_DATETIME
wxDateTime* date = new wxDateTime;
#endif // wxUSE_DATETIME
- // non-object allocation
- char *ordinaryNonObject = new char[1000];
-
const char *data = (const char*) thing ;
const char *data = (const char*) thing ;
// On MSW, Dump() crashes if using wxLogGui,
// so use wxLogStderr instead.
wxLog* oldLog = wxLog::SetActiveTarget(new wxLogStderr);
// On MSW, Dump() crashes if using wxLogGui,
// so use wxLogStderr instead.
wxLog* oldLog = wxLog::SetActiveTarget(new wxLogStderr);
// Set back to wxLogGui
delete wxLog::SetActiveTarget(oldLog);
// Set back to wxLogGui
delete wxLog::SetActiveTarget(oldLog);
// Don't delete these objects, to force wxApp to flag a memory leak.
// delete thing;
// Don't delete these objects, to force wxApp to flag a memory leak.
// delete thing;