// Created: 03/12/01
// RCS-ID: $Id$
// Copyright: (c) 2001 Ron Lee <ron@debian.org>
-// Licence: wxWidgets licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
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;
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));
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();
}