]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed wxPluginLibrary unloading on failture (patch #962838)
authorVáclav Slavík <vslavik@fastmail.fm>
Sun, 6 Jun 2004 15:15:58 +0000 (15:15 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sun, 6 Jun 2004 15:15:58 +0000 (15:15 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27664 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/dynload.cpp

index ac6aa3703061abd6693d0beed51038ce5cf6db7c..5bb2496dff8b44063a705259fd032bfa60f153ec 100644 (file)
@@ -120,7 +120,7 @@ bool wxPluginLibrary::UnrefLib()
     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;
@@ -148,6 +148,10 @@ void wxPluginLibrary::UpdateClasses()
 
 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));