Add wxModule::AreInitialized()

This internal function will be useful to check if the modules are
already initialized, i.e. if the library is in the "steady state"
between the end of the initialization and the beginning of the cleanup
phases.
This commit is contained in:
Vadim Zeitlin
2021-03-07 20:37:09 +01:00
parent fbd23270e3
commit 5ddf57c150
3 changed files with 22 additions and 1 deletions

View File

@@ -25,6 +25,7 @@
wxIMPLEMENT_ABSTRACT_CLASS(wxModule, wxObject)
wxModuleList wxModule::ms_modules;
bool wxModule::ms_areInitialized = false;
void wxModule::RegisterModule(wxModule* module)
{
@@ -178,9 +179,18 @@ bool wxModule::InitializeModules()
// remember the real initialisation order
ms_modules = initializedModules;
ms_areInitialized = true;
return true;
}
void wxModule::CleanUpModules()
{
DoCleanUpModules(ms_modules);
ms_areInitialized = false;
}
// Clean up all currently initialized modules
void wxModule::DoCleanUpModules(const wxModuleList& modules)
{