// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "dynload.h"
-#endif
-
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
{
wxPluginLibrary::ms_classes = new wxDLImports;
wxPluginManager::CreateManifest();
- return TRUE;
+ return true;
}
virtual void OnExit()
wxASSERT_MSG( m_objcount == 0,
_T("Library unloaded before all objects were destroyed") );
- if ( --m_linkcount == 0 )
+ if ( m_linkcount == 0 || --m_linkcount == 0 )
{
delete this;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
// ------------------------
{
for (wxClassInfo *info = m_after; info != m_before; info = info->m_next)
{
- if( info->m_className )
+ if( info->GetClassName() )
{
// 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;
+ (*ms_classes)[info->GetClassName()] = this;
}
}
}
void wxPluginLibrary::RestoreClasses()
{
+ // Check if there is a need to restore classes.
+ if (!ms_classes)
+ return;
+
for(wxClassInfo *info = m_after; info != m_before; info = info->m_next)
{
- ms_classes->erase(ms_classes->find(info->m_className));
+ ms_classes->erase(ms_classes->find(info->GetClassName()));
}
}
for ( it = m_wxmodules.begin(); it != m_wxmodules.end(); ++it )
wxModule::UnregisterModule( *it );
- WX_CLEAR_LIST(wxModuleList, m_wxmodules);
+ // NB: content of the list was deleted by UnregisterModule calls above:
+ m_wxmodules.clear();
}
wxLogDebug(_T("Attempt to unload library '%s' which is not loaded."),
libname.c_str());
- return FALSE;
+ return false;
}
wxLogTrace(_T("dll"), _T("UnloadLibrary(%s)"), realname.c_str());
if ( !entry->UnrefLib() )
{
// not really unloaded yet
- return FALSE;
+ return false;
}
ms_manifest->erase(ms_manifest->find(realname));
- return TRUE;
+ return true;
}
// ------------------------
wxFAIL_MSG( _T("Using a library not loaded with wxDllLoader?") );
if ( success )
- *success = FALSE;
+ *success = false;
return NULL;
}
// Some system may use a local heap for library.
get_first = (t_get_first)GetSymbol(_T("wxGetClassFirst"));
- // It is a wxWindows DLL.
+ // It is a wxWidgets DLL.
if (get_first)
PrepareClasses(get_first());
}
wxLibraries::~wxLibraries()
{
- wxNode *node = m_loaded.First();
+ wxNode *node = m_loaded.GetFirst();
while (node) {
- wxLibrary *lib = (wxLibrary *)node->Data();
+ wxLibrary *lib = (wxLibrary *)node->GetData();
delete lib;
- node = node->Next();
+ node = node->GetNext();
}
}
wxNode *node = m_loaded.Find(name.GetData());
if (node != NULL)
- return ((wxLibrary *)node->Data());
+ return ((wxLibrary *)node->GetData());
// If DLL shares data, this is necessary.
old_sm_first = wxClassInfo::sm_first;
wxString libname = ConstructLibraryName(name);
- bool success = FALSE;
+ bool success = false;
wxDllType handle = wxDllLoader::LoadLibrary(libname, &success);
if(success)
{
wxObject *wxLibraries::CreateObject(const wxString& path)
{
- wxNode *node = m_loaded.First();
+ wxNode *node = m_loaded.GetFirst();
wxObject *obj;
while (node) {
- obj = ((wxLibrary *)node->Data())->CreateObject(path);
+ obj = ((wxLibrary *)node->GetData())->CreateObject(path);
if (obj)
return obj;
- node = node->Next();
+ node = node->GetNext();
}
return NULL;
}