, m_baseInfo1(0)
, m_baseInfo2(0)
, m_next(sm_first)
+ { sm_first = this; }
+
+ ~wxClassInfo()
+ {
+ if (sm_first == this)
{
-#ifdef __WXDEBUG__
- if (sm_classTable != NULL) {
- wxString msg(_T("too late binding of class info (lazy binding) for "));
- msg += className;
- wxFAIL_MSG(msg);
+ 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;
}
-#endif
- sm_first = this;
}
+ }
wxObject *CreateObject() { return m_objectConstructor ? (*m_objectConstructor)() : 0; }
class WXDLLEXPORT wxObject
{
DECLARE_ABSTRACT_CLASS(wxObject)
- DECLARE_NO_COPY_CLASS(wxObject)
+private:
+ void InitFrom(const wxObject& other);
+
public:
wxObject() { m_refData = NULL; }
virtual ~wxObject() { UnRef(); }
+ wxObject(const wxObject& other)
+ {
+ InitFrom(other);
+ }
+
+ wxObject& operator=(const wxObject& other)
+ {
+ if ( this != &other )
+ {
+ UnRef();
+ InitFrom(other);
+ }
+ return *this;
+ }
+
bool IsKindOf(wxClassInfo *info) const;