X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0b9ab0bd824b6b9c93849928d67de1ec71e7c167..066f1b7a9580fc6c487efa753d61e3683de61407:/src/common/module.cpp diff --git a/src/common/module.cpp b/src/common/module.cpp index 0853642073..e8ddb80a0a 100644 --- a/src/common/module.cpp +++ b/src/common/module.cpp @@ -24,14 +24,7 @@ #include "wx/hash.h" #include "wx/listimpl.cpp" -#ifdef __SALFORDC__ -void wxwxModuleListNode::DeleteData() -{ - delete (_WX_LIST_ITEM_TYPE_wxModuleList *)GetData(); -} -#else WX_DEFINE_LIST(wxModuleList); -#endif IMPLEMENT_CLASS(wxModule, wxObject) @@ -45,20 +38,21 @@ 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(); node = wxClassInfo::sm_classTable->Next(); while (node) { - classInfo = (wxClassInfo *)node->Data(); + classInfo = (wxClassInfo *)node->GetData(); if ( classInfo->IsKindOf(CLASSINFO(wxModule)) && (classInfo != (& (wxModule::sm_classwxModule))) ) { @@ -72,13 +66,13 @@ 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(); @@ -94,13 +88,12 @@ bool wxModule::InitializeModules() 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); }