projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Warning fix
[wxWidgets.git]
/
src
/
common
/
module.cpp
diff --git
a/src/common/module.cpp
b/src/common/module.cpp
index d296b83d68794da38f66361ff16ff5aeff07ce54..2d5df449544f039f5695dc06765977f91ba074d5 100644
(file)
--- a/
src/common/module.cpp
+++ b/
src/common/module.cpp
@@
-9,10
+9,6
@@
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
-#pragma implementation "module.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
@@
-22,16
+18,13
@@
#include "wx/module.h"
#include "wx/hash.h"
#include "wx/module.h"
#include "wx/hash.h"
+#include "wx/intl.h"
+#include "wx/log.h"
#include "wx/listimpl.cpp"
#include "wx/listimpl.cpp"
-#ifdef __SALFORDC__
-void wxwxModuleListNode::DeleteData()
-{
- delete (_WX_LIST_ITEM_TYPE_wxModuleList *)GetData();
-}
-#else
-WX_DEFINE_LIST(wxModuleList);
-#endif
+#define TRACE_MODULE _T("module")
+
+WX_DEFINE_LIST(wxModuleList)
IMPLEMENT_CLASS(wxModule, wxObject)
IMPLEMENT_CLASS(wxModule, wxObject)
@@
-45,13
+38,14
@@
void wxModule::RegisterModule(wxModule* module)
void wxModule::UnregisterModule(wxModule* module)
{
m_modules.DeleteObject(module);
void wxModule::UnregisterModule(wxModule* module)
{
m_modules.DeleteObject(module);
+ delete module;
}
// Collect up all module-derived classes, create an instance of each,
// and register them.
void wxModule::RegisterModules()
{
}
// Collect up all module-derived classes, create an instance of each,
// and register them.
void wxModule::RegisterModules()
{
- wx
Node *
node;
+ wx
HashTable::compatibility_iterator
node;
wxClassInfo* classInfo;
wxClassInfo::sm_classTable->BeginFind();
wxClassInfo* classInfo;
wxClassInfo::sm_classTable->BeginFind();
@@
-60,8
+54,10
@@
void wxModule::RegisterModules()
{
classInfo = (wxClassInfo *)node->GetData();
if ( classInfo->IsKindOf(CLASSINFO(wxModule)) &&
{
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);
}
wxModule* module = (wxModule *)classInfo->CreateObject();
RegisterModule(module);
}
@@
-72,35
+68,40
@@
void wxModule::RegisterModules()
bool wxModule::InitializeModules()
{
// Initialize user-defined modules
bool wxModule::InitializeModules()
{
// Initialize user-defined modules
- wxModuleList::
Node *
node;
+ wxModuleList::
compatibility_iterator
node;
for ( node = m_modules.GetFirst(); node; node = node->GetNext() )
{
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
// clean up already initialized modules - process in reverse order
- wxModuleList::
Node *
n;
+ wxModuleList::
compatibility_iterator
n;
for ( n = node->GetPrevious(); n; n = n->GetPrevious() )
{
n->GetData()->OnExit();
}
for ( n = node->GetPrevious(); n; n = n->GetPrevious() )
{
n->GetData()->OnExit();
}
- return
FALSE
;
+ return
false
;
}
}
}
}
- return
TRUE
;
+ return
true
;
}
void wxModule::CleanUpModules()
{
// Cleanup user-defined modules
}
void wxModule::CleanUpModules()
{
// Cleanup user-defined modules
- wxModuleList::
Node *
node;
+ wxModuleList::
compatibility_iterator
node;
for ( node = m_modules.GetFirst(); node; node = node->GetNext() )
{
for ( node = m_modules.GetFirst(); node; node = node->GetNext() )
{
+ wxLogTrace(TRACE_MODULE, wxT("Cleanup module %s"),
+ node->GetData()->GetClassInfo()->GetClassName());
node->GetData()->Exit();
}
node->GetData()->Exit();
}
- m_modules.DeleteContents(TRUE);
- m_modules.Clear();
+ WX_CLEAR_LIST(wxModuleList, m_modules);
}
}