X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b1d4dd7add411ebff1ce4a8d1d992e0e43ee26b1..c5fc899bf29ca7d9c4e2a070e28228b430a68dd3:/src/common/module.cpp diff --git a/src/common/module.cpp b/src/common/module.cpp index d296b83d68..eee9507ee1 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 @@ -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,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(); @@ -60,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); @@ -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); }