X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/df5168c427b51f1ab2b3200a5c8f7626b3d24aae..b9efe021b554fa3967d1442cf758435c5cd5ae8f:/src/common/module.cpp diff --git a/src/common/module.cpp b/src/common/module.cpp index e8ddb80a0a..e4b0ea9afa 100644 --- a/src/common/module.cpp +++ b/src/common/module.cpp @@ -9,7 +9,7 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "module.h" #endif @@ -22,6 +22,8 @@ #include "wx/module.h" #include "wx/hash.h" +#include "wx/intl.h" +#include "wx/log.h" #include "wx/listimpl.cpp" WX_DEFINE_LIST(wxModuleList); @@ -54,7 +56,7 @@ void wxModule::RegisterModules() { classInfo = (wxClassInfo *)node->GetData(); if ( classInfo->IsKindOf(CLASSINFO(wxModule)) && - (classInfo != (& (wxModule::sm_classwxModule))) ) + (classInfo != (& (wxModule::ms_classInfo))) ) { wxModule* module = (wxModule *)classInfo->CreateObject(); RegisterModule(module); @@ -69,8 +71,12 @@ bool wxModule::InitializeModules() wxModuleList::compatibility_iterator node; for ( node = m_modules.GetFirst(); node; node = node->GetNext() ) { - if ( !node->GetData()->Init() ) + wxModule *module = node->GetData(); + if ( !module->Init() ) { + wxLogError(_("Module \"%s\" initialization failed"), + module->GetClassInfo()->GetClassName()); + // clean up already initialized modules - process in reverse order wxModuleList::compatibility_iterator n; for ( n = node->GetPrevious(); n; n = n->GetPrevious() ) @@ -78,11 +84,11 @@ bool wxModule::InitializeModules() n->GetData()->OnExit(); } - return FALSE; + return false; } } - return TRUE; + return true; } void wxModule::CleanUpModules()