wxObject *wxObject::Clone() const
{
- return GetClassInfo()->CreateObject();
+ wxObject *object = GetClassInfo()->CreateObject();
+ CopyObject(*object);
+ return object;
+}
+
+void wxObject::CopyObject(wxObject& object_dest) const
+{
+ wxASSERT(object_dest.GetClassInfo()->IsKindOf(GetClassInfo()));
}
#if defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT