X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/df5168c427b51f1ab2b3200a5c8f7626b3d24aae..7b504551c292ecb4296693983161ac5ad03745f6:/src/common/module.cpp diff --git a/src/common/module.cpp b/src/common/module.cpp index e8ddb80a0a..2d5df44954 100644 --- a/src/common/module.cpp +++ b/src/common/module.cpp @@ -9,10 +9,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "module.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -22,9 +18,13 @@ #include "wx/module.h" #include "wx/hash.h" +#include "wx/intl.h" +#include "wx/log.h" #include "wx/listimpl.cpp" -WX_DEFINE_LIST(wxModuleList); +#define TRACE_MODULE _T("module") + +WX_DEFINE_LIST(wxModuleList) IMPLEMENT_CLASS(wxModule, wxObject) @@ -54,8 +54,10 @@ void wxModule::RegisterModules() { classInfo = (wxClassInfo *)node->GetData(); if ( classInfo->IsKindOf(CLASSINFO(wxModule)) && - (classInfo != (& (wxModule::sm_classwxModule))) ) + (classInfo != (& (wxModule::ms_classInfo))) ) { + wxLogTrace(TRACE_MODULE, wxT("Registering module %s"), + classInfo->GetClassName()); 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() @@ -91,6 +97,8 @@ void wxModule::CleanUpModules() wxModuleList::compatibility_iterator node; for ( node = m_modules.GetFirst(); node; node = node->GetNext() ) { + wxLogTrace(TRACE_MODULE, wxT("Cleanup module %s"), + node->GetData()->GetClassInfo()->GetClassName()); node->GetData()->Exit(); }