X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/55d99c7a77789ff4904bf96eddca3715eb5af9b9..d546eba94e77831c41e3370484a41181517bd611:/src/common/object.cpp diff --git a/src/common/object.cpp b/src/common/object.cpp index cb965e7c45..8dad5efc0f 100644 --- a/src/common/object.cpp +++ b/src/common/object.cpp @@ -43,11 +43,22 @@ #endif #endif // __WXDEBUG__ || wxUSE_DEBUG_CONTEXT +// we must disable optimizations for VC.NET because otherwise its too eager +// linker discards wxClassInfo objects in release build thus breaking many, +// many things +#if defined __VISUALC__ && __VISUALC__ >= 1300 + #pragma optimize("", off) +#endif wxClassInfo wxObject::sm_classwxObject( wxT("wxObject"), 0, 0, (int) sizeof(wxObject), (wxObjectConstructorFn) 0 ); +// restore optimizations +#if defined __VISUALC__ && __VISUALC__ >= 1300 + #pragma optimize("", on) +#endif + wxClassInfo* wxClassInfo::sm_first = NULL; wxHashTable* wxClassInfo::sm_classTable = NULL; @@ -188,13 +199,17 @@ inline wxClassInfo *wxClassInfo::GetBaseByName(const wxChar *name) wxClassInfo *classInfo = (wxClassInfo *)sm_classTable->Get(name); - // this must be fixed, other things risk work wrongly later if you get this - wxASSERT_MSG( classInfo, - wxString::Format - ( - _T("base class '%s' is unknown to wxWindows RTTI"), - name - ) ); +#ifdef __WXDEBUG__ + // this must be fixed, other things will work wrongly later if you get this + if ( !classInfo ) + { + wxFAIL_MSG( wxString::Format + ( + _T("base class '%s' is unknown to wxWindows RTTI"), + name + ) ); + } +#endif // __WXDEBUG__ return classInfo; }