diff options
-rw-r--r-- | project2/common/variables/config.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/project2/common/variables/config.cpp b/project2/common/variables/config.cpp index 5b36f6e..e134d07 100644 --- a/project2/common/variables/config.cpp +++ b/project2/common/variables/config.cpp @@ -69,18 +69,23 @@ class VariableConfigLoader : public VariableLoader::For<VariableConfig> { } }; VariableConfigLoader() : - opts("Variables - ModConfig options") + opts(new Options("Variables - ModConfig options")) { - opts(new AppSettings()); - OptionsSets::Add(typeid(AppSettings).name(), &opts); + (*opts)(new AppSettings()); + OptionsSets::Add(typeid(AppSettings).name(), opts); + } + + ~VariableConfigLoader() + { + OptionsSets::Remove(typeid(AppSettings).name()); } const Options * options() const { - return &opts; + return opts; } private: - Options opts; + Options * opts; }; DECLARE_CUSTOM_COMPONENT_LOADER("config", VariableConfigLoader, VariableConfigLoader, VariableLoader); |