]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/object.cpp
Added inline setters for wxTreeEvent so we don't need to add new
[wxWidgets.git] / src / common / object.cpp
index b3b09abf9252da9cf13a028e200a149e29bafe02..cb965e7c45fcf009d4c1a550d9d8da570ccb27c9 100644 (file)
@@ -5,9 +5,9 @@
 // Modified by: Ron Lee
 // Created:     04/01/98
 // RCS-ID:      $Id$
-// Copyright:   (c) 1998 Julian Smart and Markus Holzem
+// Copyright:   (c) 1998 Julian Smart
 //              (c) 2001 Ron Lee <ron@debian.org>
-// Licence:     wxWindows license
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #ifdef __GNUG__
@@ -82,7 +82,6 @@ void wxObject::Dump(wxSTD ostream& str)
 #endif
 
 
-
 #ifdef _WX_WANT_NEW_SIZET_WXCHAR_INT
 void *wxObject::operator new ( size_t size, const wxChar *fileName, int lineNum )
 {
@@ -137,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 )
@@ -247,9 +271,18 @@ wxObject *wxCreateDynamicObject(const wxChar *name)
 
 
 // ----------------------------------------------------------------------------
-// wxClassInfo
+// wxObject
 // ----------------------------------------------------------------------------
 
+// Initialize ref data from another object (needed for copy constructor and
+// assignment operator)
+void wxObject::InitFrom(const wxObject& other)
+{
+    m_refData = other.m_refData;
+    if ( m_refData )
+        m_refData->m_count++;
+}
+
 void wxObject::Ref(const wxObject& clone)
 {
 #if defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT