+ // remember the real initialisation order
+ m_modules = initializedModules;
+
+ return true;
+}
+
+// Clean up all currently initialized modules
+void wxModule::DoCleanUpModules(const wxModuleList& modules)
+{
+ // cleanup user-defined modules in the reverse order compared to their
+ // initialization -- this ensures that dependencies are respected
+ for ( wxModuleList::compatibility_iterator node = modules.GetLast();
+ node;
+ node = node->GetPrevious() )
+ {
+ wxLogTrace(TRACE_MODULE, wxT("Cleanup module %s"),
+ node->GetData()->GetClassInfo()->GetClassName());
+
+ wxModule * module = node->GetData();
+
+ wxASSERT_MSG( module->m_state == State_Initialized,
+ _T("not initialized module being cleaned up") );
+
+ module->Exit();
+ module->m_state = State_Registered;
+ }
+
+ // clear all modules, even the non-initialized ones