1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 00:37:15 +01:00

Release all script objects from command listeners.

This commit is contained in:
Sandu Liviu Catalin 2020-05-11 17:24:36 +03:00
parent 508d968744
commit 59e4b9ad7c

View File

@ -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