summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Core/ConfigManager.cpp9
-rw-r--r--src/Core/ConfigManager.h3
2 files changed, 10 insertions, 2 deletions
diff --git a/src/Core/ConfigManager.cpp b/src/Core/ConfigManager.cpp
index 1cb4aa0..e9cc87e 100644
--- a/src/Core/ConfigManager.cpp
+++ b/src/Core/ConfigManager.cpp
@@ -106,8 +106,13 @@ void ConfigManager::configure() {
if(configured)
return;
- for(std::set<Configurable*, Compare>::iterator c = configurables.begin(); c != configurables.end(); ++c)
- (*c)->configure();
+ while(!unconfiguredConfigurables.empty()) {
+ std::set<Configurable*, Compare>::iterator it = unconfiguredConfigurables.begin();
+ Configurable *c = *it;
+ unconfiguredConfigurables.erase(it);
+
+ c->configure();
+ }
configured = true;
}
diff --git a/src/Core/ConfigManager.h b/src/Core/ConfigManager.h
index 2c11de9..9869f5a 100644
--- a/src/Core/ConfigManager.h
+++ b/src/Core/ConfigManager.h
@@ -45,6 +45,7 @@ class MAD_CORE_EXPORT ConfigManager : public ConfigEntry {
Application *application;
std::set<Configurable*, Compare> configurables;
+ std::set<Configurable*, Compare> unconfiguredConfigurables;
bool configured;
ConfigManager(Application *application0) : application(application0), configured(false) {}
@@ -55,10 +56,12 @@ class MAD_CORE_EXPORT ConfigManager : public ConfigEntry {
void registerConfigurable(Configurable *c) {
configurables.insert(c);
+ unconfiguredConfigurables.insert(c);
}
void unregisterConfigurable(Configurable *c) {
configurables.erase(c);
+ unconfiguredConfigurables.erase(c);
}
};