X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fe9c9eb0227e2f2b50e470bc2e97d6432f3bcf48..768a499594fd9c9fd0155d0513c7f5b785ce4439:/src/common/module.cpp diff --git a/src/common/module.cpp b/src/common/module.cpp index 8397312756..5534c4c2dd 100644 --- a/src/common/module.cpp +++ b/src/common/module.cpp @@ -9,7 +9,7 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "module.h" #endif @@ -38,13 +38,14 @@ void wxModule::RegisterModule(wxModule* module) void wxModule::UnregisterModule(wxModule* module) { m_modules.DeleteObject(module); + delete module; } // Collect up all module-derived classes, create an instance of each, // and register them. void wxModule::RegisterModules() { - wxNode *node; + wxHashTable::compatibility_iterator node; wxClassInfo* classInfo; wxClassInfo::sm_classTable->BeginFind(); @@ -53,7 +54,7 @@ void wxModule::RegisterModules() { classInfo = (wxClassInfo *)node->GetData(); if ( classInfo->IsKindOf(CLASSINFO(wxModule)) && - (classInfo != (& (wxModule::sm_classwxModule))) ) + (classInfo != (& (wxModule::ms_classInfo))) ) { wxModule* module = (wxModule *)classInfo->CreateObject(); RegisterModule(module); @@ -65,35 +66,34 @@ void wxModule::RegisterModules() bool wxModule::InitializeModules() { // Initialize user-defined modules - wxModuleList::Node *node; + wxModuleList::compatibility_iterator node; for ( node = m_modules.GetFirst(); node; node = node->GetNext() ) { if ( !node->GetData()->Init() ) { // clean up already initialized modules - process in reverse order - wxModuleList::Node *n; + wxModuleList::compatibility_iterator n; for ( n = node->GetPrevious(); n; n = n->GetPrevious() ) { n->GetData()->OnExit(); } - return FALSE; + return false; } } - return TRUE; + return true; } void wxModule::CleanUpModules() { // Cleanup user-defined modules - wxModuleList::Node *node; + wxModuleList::compatibility_iterator node; for ( node = m_modules.GetFirst(); node; node = node->GetNext() ) { node->GetData()->Exit(); } - m_modules.DeleteContents(TRUE); - m_modules.Clear(); + WX_CLEAR_LIST(wxModuleList, m_modules); }