X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/14f355c2b5c71fc7c3d680aea366582d2ac60f7b..f009156727ddfbca08197b63d0fbee00df4078f5:/src/common/dynload.cpp diff --git a/src/common/dynload.cpp b/src/common/dynload.cpp index a0844febf6..80d809e528 100644 --- a/src/common/dynload.cpp +++ b/src/common/dynload.cpp @@ -58,7 +58,7 @@ public: // TODO: create ms_classes on demand, why always preallocate it? virtual bool OnInit() { - wxPluginLibrary::ms_classes = new wxDLImports(wxKEY_STRING); + wxPluginLibrary::ms_classes = new wxDLImports; wxPluginManager::CreateManifest(); return TRUE; } @@ -87,7 +87,7 @@ wxPluginLibrary::wxPluginLibrary(const wxString &libname, int flags) if( m_handle != 0 ) { - UpdateClassInfo(); + UpdateClasses(); RegisterModules(); } else @@ -102,7 +102,7 @@ wxPluginLibrary::~wxPluginLibrary() if( m_handle != 0 ) { UnregisterModules(); - RestoreClassInfo(); + RestoreClasses(); } } @@ -133,27 +133,12 @@ bool wxPluginLibrary::UnrefLib() // Private methods // ------------------------ -void wxPluginLibrary::UpdateClassInfo() +void wxPluginLibrary::UpdateClasses() { - wxClassInfo *info; - wxHashTable *t = wxClassInfo::sm_classTable; - - // FIXME: Below is simply a cut and paste specialisation of - // wxClassInfo::InitializeClasses. Once this stabilises, - // the two should probably be merged. - // - // Actually it's becoming questionable whether we should merge - // this info with the main ClassInfo tables since we can nearly - // handle this completely internally now and it does expose - // certain (minimal % user_stupidy) risks. - - for(info = m_after; info != m_before; info = info->m_next) + for (wxClassInfo *info = m_after; info != m_before; info = info->m_next) { if( info->m_className ) { - if( t->Get(info->m_className) == 0 ) - t->Put(info->m_className, (wxObject *)info); - // Hash all the class names into a local table too so // we can quickly find the entry they correspond to. (*ms_classes)[info->m_className] = this; @@ -161,27 +146,12 @@ void wxPluginLibrary::UpdateClassInfo() } } -void wxPluginLibrary::RestoreClassInfo() +void wxPluginLibrary::RestoreClasses() { - wxClassInfo *info; - - for(info = m_after; info != m_before; info = info->m_next) + for(wxClassInfo *info = m_after; info != m_before; info = info->m_next) { - wxClassInfo::sm_classTable->Delete(info->m_className); ms_classes->erase(ms_classes->find(info->m_className)); } - - if( wxClassInfo::sm_first == m_after ) - wxClassInfo::sm_first = m_before; - else - { - info = wxClassInfo::sm_first; - while( info->m_next && info->m_next != m_after ) info = info->m_next; - - wxASSERT_MSG( info, _T("ClassInfo from wxPluginLibrary not found on purge")); - - info->m_next = m_before; - } } void wxPluginLibrary::RegisterModules()