X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cf760e4c30a0324f441989dbf8362c63472336ec..81b32ce52247c45d278507ebeb532e2535bbe186:/src/common/object.cpp diff --git a/src/common/object.cpp b/src/common/object.cpp index c091b0c681..7148e579b3 100644 --- a/src/common/object.cpp +++ b/src/common/object.cpp @@ -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 ) { @@ -189,7 +188,7 @@ void wxClassInfo::InitializeClasses() size_t nClass = 0; #endif - wxClassInfo::sm_classTable = new wxHashTable(wxKEY_STRING); + sm_classTable = new wxHashTable(wxKEY_STRING); // Index all class infos by their class name @@ -247,9 +246,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 @@ -325,17 +333,17 @@ wxObject::CloneRefData(const wxObjectRefData * WXUNUSED(data)) const // misc // ---------------------------------------------------------------------------- -#if defined(__DARWIN__) && defined(DYLIB_INIT) +#if defined(__DARWIN__) && defined(WXMAKINGDLL) extern "C" { void __initialize_Cplusplus(void); void wxWindowsDylibInit(void); }; - // Dynamic shared library (dylib) initialization routine - // required to initialize static C++ objects bacause of lazy dynamic linking - // http://developer.apple.com/techpubs/macosx/Essentials/ - // SystemOverview/Frameworks/Dynamic_Shared_Libraries.html +// Dynamic shared library (dylib) initialization routine +// required to initialize static C++ objects bacause of lazy dynamic linking +// http://developer.apple.com/techpubs/macosx/Essentials/ +// SystemOverview/Frameworks/Dynamic_Shared_Libraries.html void wxWindowsDylibInit() { @@ -343,6 +351,8 @@ void wxWindowsDylibInit() // library initialization routine to cause the static C++ objects in // the library to be initialized (reference number 2441683). + // This only seems to be necessary if the library initialization routine + // needs to use the static C++ objects __initialize_Cplusplus(); }