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

Forgot to release a couple references to Squirrel objects causing a crash when the smart pointers tried to release them after the VM was destroyed.

This commit is contained in:
Sandu Liviu Catalin 2015-10-03 19:44:26 +03:00
parent 20a78ab268
commit 231d05174d

View File

@ -363,9 +363,16 @@ bool Core::CreateVM() noexcept
void Core::DestroyVM() noexcept
{
// See if the Virtual Machine wasn't already destroyed
if (m_VM != nullptr)
{
// Release the reference to the root table
m_RootTable.reset();
// Release the references to the script objects
m_Scripts.clear();
// Close the Virtual Machine
sq_close(m_VM);
// Set the virtual machine to null
m_VM = nullptr;
}
}