]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/object.cpp
Minor corrections.
[wxWidgets.git] / src / common / object.cpp
index 7148e579b3d60835cdd18d08bec5ce46e2c89ca0..bbbf5350e3ae294217dd2ca63780a0cc600845cd 100644 (file)
@@ -136,6 +136,31 @@ void wxObject::operator delete[] (void * buf, const wxChar*  WXUNUSED(fileName),
 // wxClassInfo
 // ----------------------------------------------------------------------------
 
+wxClassInfo::~wxClassInfo()
+{
+    // remove this object from the linked list of all class infos: if we don't
+    // do it, loading/unloading a DLL containing static wxClassInfo objects is
+    // not going to work
+    if ( this == sm_first )
+    {
+        sm_first = m_next;
+    }
+    else
+    {
+        wxClassInfo *info = sm_first;
+        while (info)
+        {
+            if ( info->m_next == this )
+            {
+                info->m_next = m_next;
+                break;
+            }
+
+            info = info->m_next;
+        }
+    }
+}
+
 wxClassInfo *wxClassInfo::FindClass(const wxChar *className)
 {
     if ( sm_classTable )