- wxClassInfo *info = wxClassInfo::first;
- while (info)
- {
- if (info->className && strcmp(info->className, name) == 0)
- return info->CreateObject();
- info = info->next;
- }
- return (wxObject *) NULL;
+ delete wxClassInfo::sm_classTable;
+ wxClassInfo::sm_classTable = NULL;
+}
+
+wxObject *wxCreateDynamicObject(const wxChar *name)
+{
+ if (wxClassInfo::sm_classTable)
+ {
+ wxClassInfo *info = (wxClassInfo *)wxClassInfo::sm_classTable->Get(name);
+ if (!info)
+ return (wxObject *)NULL;
+
+ return info->CreateObject();
+ }
+ else
+ {
+ wxClassInfo *info = wxClassInfo::sm_first;
+ while (info)
+ {
+ if (info->m_className && wxStrcmp(info->m_className, name) == 0)
+ return info->CreateObject();
+ info = info->m_next;
+ }
+ return (wxObject*) NULL;
+ }
+ return (wxObject*) NULL;