-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
- // At this point we want to check if there are any memory
- // blocks that aren't part of the wxDebugContext itself,
- // as a special case. Then when dumping we need to ignore
- // wxDebugContext, too.
+ wxLog *oldLog = wxLog::SetActiveTarget( NULL );
+ if (oldLog) delete oldLog;
+
+ wxClassInfo::CleanUpClasses();
+
+ delete[] wxBuffer;
+
+#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
+