+//----------------------------------------------------------------------------
+// Final cleanup after all global objects in all files have been destructed
+//----------------------------------------------------------------------------
+
+// Don't set it to 0 by dynamic initialization
+// Some compilers will realy do the asignment later
+// All global variables are initialized to 0 at the very beginning, and this is just fine.
+int wxDebugContextDumpDelayCounter::sm_count;
+
+void wxDebugContextDumpDelayCounter::DoDump()
+{
+ if (wxDebugContext::CountObjectsLeft(true) > 0)
+ {
+ wxDebugContext::OutputDumpLine(wxT("There were memory leaks.\n"));
+ wxDebugContext::Dump();
+ wxDebugContext::PrintStatistics();
+ }
+}
+
+// Even if there is nothing else, make sure that there is at
+// least one clenup counter object
+static wxDebugContextDumpDelayCounter wxDebugContextDumpDelayCounter_One;
+
+#endif // (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT