]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/object.cpp
Fix recursion problems when loading pages from a virtual file system using the WebKit...
[wxWidgets.git] / src / common / object.cpp
index 57825a52c5d3ee07d0121e443a7afa5dd3eec21b..fbcd2766b56f2564c504ccac73fbeb960023c0e8 100644 (file)
 
 #if wxUSE_EXTENDED_RTTI
 const wxClassInfo* wxObject::ms_classParents[] = { NULL } ;
- wxObject* wxVariantToObjectConverterwxObject ( wxxVariant &data )
-{ return data.wxTEMPLATED_MEMBER_CALL(Get , wxObject*) ; }
- wxObject* wxVariantOfPtrToObjectConverterwxObject ( wxxVariant &data )
-{ return &data.wxTEMPLATED_MEMBER_CALL(Get , wxObject) ; }
- wxxVariant wxObjectToVariantConverterwxObject ( wxObject *data )
- { return wxxVariant( dynamic_cast<wxObject*> (data)  ) ; }
+wxObject* wxVariantOfPtrToObjectConverterwxObject ( const wxAny &data )
+{ return wxANY_AS(data, wxObject*); }
+ wxAny wxObjectToVariantConverterwxObject ( wxObject *data )
+ { return wxAny( dynamic_cast<wxObject*> (data)  ) ; }
+
  wxClassInfo wxObject::ms_classInfo(ms_classParents , wxEmptyString , wxT("wxObject"),
             (int) sizeof(wxObject),                              \
             (wxObjectConstructorFn) 0   ,
             NULL,NULL,0 , 0 ,
-            0 , wxVariantOfPtrToObjectConverterwxObject , wxVariantToObjectConverterwxObject , wxObjectToVariantConverterwxObject);
- template<> void wxStringReadValue(const wxString & , wxObject * & ){assert(0) ;}
- template<> void wxStringWriteValue(wxString & , wxObject* const & ){assert(0) ;}
- template<> void wxStringReadValue(const wxString & , wxObject & ){assert(0) ;}
- template<> void wxStringWriteValue(wxString & , wxObject const & ){assert(0) ;}
+            0 , wxVariantOfPtrToObjectConverterwxObject , 0 , wxObjectToVariantConverterwxObject);
+
+ template<> void wxStringWriteValue(wxString & , wxObject* const & ){ wxFAIL_MSG("unreachable"); }
+ template<> void wxStringWriteValue(wxString & , wxObject const & ){ wxFAIL_MSG("unreachable"); }
+
  wxClassTypeInfo s_typeInfo(wxT_OBJECT_PTR , &wxObject::ms_classInfo , NULL , NULL , typeid(wxObject*).name() ) ;
  wxClassTypeInfo s_typeInfowxObject(wxT_OBJECT , &wxObject::ms_classInfo , NULL , NULL , typeid(wxObject).name() ) ;
 #else
@@ -283,8 +282,7 @@ void wxClassInfo::Unregister()
         sm_classTable->Delete(m_className);
         if ( sm_classTable->GetCount() == 0 )
         {
-            delete sm_classTable;
-            sm_classTable = NULL;
+            wxDELETE(sm_classTable);
         }
     }
 }