From 59e4b9ad7c8951c5822a65c50689760c311e4f83 Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Mon, 11 May 2020 17:24:36 +0300 Subject: [PATCH] Release all script objects from command listeners. --- module/Misc/Command.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/module/Misc/Command.hpp b/module/Misc/Command.hpp index 4b3c767b..30cd4f85 100644 --- a/module/Misc/Command.hpp +++ b/module/Misc/Command.hpp @@ -1105,11 +1105,19 @@ public: for (Listener * node = s_Head; node != nullptr; node = node->m_Next) { node->m_Data.Release(); + node->m_OnExec.Release(); + node->m_OnAuth.Release(); + node->m_OnPost.Release(); + node->m_OnFail.Release(); } // Go backwards and release resources for (Listener * node = s_Head; node != nullptr; node = node->m_Prev) { node->m_Data.Release(); + node->m_OnExec.Release(); + node->m_OnAuth.Release(); + node->m_OnPost.Release(); + node->m_OnFail.Release(); } // Kinda useless but Squirrel doesn't play nice with loose references // Better safe than sorry