From d97f3acae94a73472254a53b263f7ca1d84a857c Mon Sep 17 00:00:00 2001 From: Martin Hanzik <martin@hanzik.com> Date: Thu, 10 May 2018 20:40:14 +0200 Subject: [PATCH] Add Registry::deinitialize --- agui2/src/Algorithm/Registry.cpp | 6 +++++- agui2/src/Algorithm/Registry.hpp | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/agui2/src/Algorithm/Registry.cpp b/agui2/src/Algorithm/Registry.cpp index 8d494604c5..15061bef3f 100644 --- a/agui2/src/Algorithm/Registry.cpp +++ b/agui2/src/Algorithm/Registry.cpp @@ -37,6 +37,10 @@ void Registry::initialize() { } } +void Registry::deinitialize() { + Registry::getInstance().algorithms.clear(); +} + Registry& Registry::getInstance() { static Registry instance; return instance; @@ -52,4 +56,4 @@ Algorithm* Registry::getAlgorithm(const std::string& name) { const std::map<std::string, std::unique_ptr<Algorithm>>& Registry::getAlgorithms() { return Registry::getInstance().algorithms; -} \ No newline at end of file +} diff --git a/agui2/src/Algorithm/Registry.hpp b/agui2/src/Algorithm/Registry.hpp index 53ce163b4c..219c989414 100644 --- a/agui2/src/Algorithm/Registry.hpp +++ b/agui2/src/Algorithm/Registry.hpp @@ -8,6 +8,7 @@ class Registry { public: static void initialize(); + static void deinitialize(); static Algorithm* getAlgorithm(const std::string& name); static const std::map<std::string, std::unique_ptr<Algorithm>>& getAlgorithms(); -- GitLab