#include "wx/ioswrap.h"
#if !defined(__WATCOMC__) && !(defined(__VMS__) && ( __VMS_VER < 70000000 ) )\
- && !defined( __MWERKS__ ) && !defined(__SALFORDC__)
+ && !defined( __MWERKS__ )
#include <memory.h>
#endif
int wxDebugContext::m_balign = (int)((char *)&markerCalc[1] - (char*)&markerCalc[0]);
int wxDebugContext::m_balignmask = (int)((char *)&markerCalc[1] - (char*)&markerCalc[0]) - 1;
+// Pointer to global function to call at shutdown
+wxShutdownNotifyFunction wxDebugContext::sm_shutdownFn;
+
wxDebugContext::wxDebugContext(void)
{
}
}
int n = 0;
- wxHashTable::compatibility_iterator node;
- wxClassInfo *info;
+ const wxClassInfo *info;
- wxClassInfo::sm_classTable->BeginFind();
- node = wxClassInfo::sm_classTable->Next();
- while (node)
+ for (wxClassInfo::const_iterator node = wxClassInfo::begin_classinfo(),
+ end = wxClassInfo::end_classinfo();
+ node != end; ++node)
{
- info = (wxClassInfo *)node->GetData();
+ info = *node;
if (info->GetClassName())
{
wxString msg(info->GetClassName());
wxLogMessage(msg);
}
- node = wxClassInfo::sm_classTable->Next();
n ++;
}
wxLogMessage(wxEmptyString);
dbgout.Printf(buf);
}
+void wxDebugContext::SetShutdownNotifyFunction(wxShutdownNotifyFunction shutdownFn)
+{
+ sm_shutdownFn = shutdownFn;
+}
+
#if USE_THREADSAFE_MEMORY_ALLOCATION
static bool memSectionOk = false;
// All global variables are initialized to 0 at the very beginning, and this is just fine.
int wxDebugContextDumpDelayCounter::sm_count;
+wxDebugContextDumpDelayCounter::wxDebugContextDumpDelayCounter()
+{
+ sm_count++;
+}
+
+wxDebugContextDumpDelayCounter::~wxDebugContextDumpDelayCounter()
+{
+ if ( !--sm_count )
+ {
+ // Notify app if we've been asked to do that
+ if( wxDebugContext::sm_shutdownFn )
+ wxDebugContext::sm_shutdownFn();
+ DoDump();
+ }
+}
+
void wxDebugContextDumpDelayCounter::DoDump()
{
if (wxDebugContext::CountObjectsLeft(true) > 0)