From d20726621b34eb2c8cb16a4647dd7588fe342ae3 Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Fri, 5 Feb 2021 14:21:53 +0200 Subject: [PATCH] Discard object references. --- module/Core/Privilege.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/module/Core/Privilege.cpp b/module/Core/Privilege.cpp index 6f9f14fb..8402bec6 100644 --- a/module/Core/Privilege.cpp +++ b/module/Core/Privilege.cpp @@ -31,23 +31,27 @@ void PvManager::Release() // ------------------------------------------------------------------------------------------------ void PvManager::Terminate() { - // Release script objects held by classes - for (auto & c : m_Classes) - { - //c->Release(); - } // Release script objects held by units for (auto & u : m_Units) { - //c->Release(); + u.second->Release(); + } + // Release script objects held by classes + for (auto & c : m_Classes) + { + c.second->Release(); } // Release script objects held by entries for (auto & e : m_Entries) { - //c->Release(); + e.second->Release(); } // Release script objects held by the manager Release(); + // Clear the containers as well + m_Classes.clear(); + m_Units.clear(); + m_Entries.clear(); } // ------------------------------------------------------------------------------------------------