diff --git a/include/openspace/engine/openspaceengine.h b/include/openspace/engine/openspaceengine.h index 00a85e34f4..050e990a35 100644 --- a/include/openspace/engine/openspaceengine.h +++ b/include/openspace/engine/openspaceengine.h @@ -107,11 +107,11 @@ private: static OpenSpaceEngine* _engine; - ConfigurationManager* _configurationManager; - InteractionHandler* _interactionHandler; - RenderEngine* _renderEngine; - scripting::ScriptEngine* _scriptEngine; - ghoul::cmdparser::CommandlineParser* _commandlineParser; + std::unique_ptr _configurationManager; + std::unique_ptr _interactionHandler; + std::unique_ptr _renderEngine; + std::unique_ptr _scriptEngine; + std::unique_ptr _commandlineParser; #ifdef OPENSPACE_VIDEO_EXPORT bool _doVideoExport; #endif diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 0ad4808e93..5a265d35e8 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -78,15 +78,10 @@ OpenSpaceEngine::OpenSpaceEngine(std::string programName) OpenSpaceEngine::~OpenSpaceEngine() { - delete _configurationManager; _configurationManager = nullptr; - delete _interactionHandler; _interactionHandler = nullptr; - delete _renderEngine; _renderEngine = nullptr; - delete _scriptEngine; _scriptEngine = nullptr; - delete _commandlineParser; _commandlineParser = nullptr; SpiceManager::deinitialize(); diff --git a/src/tests/main.cpp b/src/tests/main.cpp index b65a6237fd..9df4efbf5d 100644 --- a/src/tests/main.cpp +++ b/src/tests/main.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -64,20 +65,8 @@ int main(int argc, char** argv) { } LINFO("Configuration file found: " << FileSys.absolutePath(configurationFilePath)); - LDEBUG("Registering base path"); - if( ! openspace::OpenSpaceEngine::registerBasePathFromConfigurationFile(configurationFilePath)) { - LFATAL("Could not register base path"); - assert(false); - } - - ghoul::Dictionary configuration; - ghoul::lua::loadDictionaryFromFile(configurationFilePath, configuration); - if (configuration.hasKey(openspace::constants::openspaceengine::keyPaths)) { - ghoul::Dictionary pathsDictionary; - if (configuration.getValue(openspace::constants::openspaceengine::keyPaths, pathsDictionary)) { - openspace::OpenSpaceEngine::registerPathsFromDictionary(pathsDictionary); - } - } + openspace::ConfigurationManager manager; + manager.loadFromFile(configurationFilePath); openspace::FactoryManager::initialize();