-// Set pointers to base class(es) to speed up IsKindOf
-void wxClassInfo::InitializeClasses()
-{
- // using IMPLEMENT_DYNAMIC_CLASS() macro twice (which may happen if you
- // link any object module twice mistakenly) will break this function
- // because it will enter an infinite loop and eventually die with "out of
- // memory" - as this is quite hard to detect if you're unaware of this,
- // try to do some checks here
-
-#ifdef __WXDEBUG__
- static const size_t nMaxClasses = 10000; // more than we'll ever have
- size_t nClass = 0;
-#endif
-
- // Do this initialization only once, because classes are added
- // automatically if
- if ( sm_classTable == NULL )
- {
- sm_classTable = new wxHashTable(wxKEY_STRING);
-
- // Index all class infos by their class name:
- wxClassInfo *info;
- for(info = sm_first; info; info = info->m_next)
- {
- if (info->m_className)
- {
- wxASSERT_MSG( ++nClass < nMaxClasses,
- _T("an infinite loop detected - have you used IMPLEMENT_DYNAMIC_CLASS() twice (may be by linking some object module(s) twice)?") );
- sm_classTable->Put(info->m_className, (wxObject *)info);
- }
- }
- }
-}
-
-void wxClassInfo::CleanUpClasses()
-{
- delete wxClassInfo::sm_classTable;
- wxClassInfo::sm_classTable = NULL;
-}
+// This function wasn't written to be reentrant but there is a possiblity of
+// reentrance if something it does causes a shared lib to load and register
+// classes. On Solaris this happens when the wxHashTable is newed, so the first
+// part of the function has been modified to handle it, and a wxASSERT checks
+// against reentrance in the remainder of the function.