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:
parent
20a78ab268
commit
231d05174d
@ -363,9 +363,16 @@ bool Core::CreateVM() noexcept
|
|||||||
|
|
||||||
void Core::DestroyVM() noexcept
|
void Core::DestroyVM() noexcept
|
||||||
{
|
{
|
||||||
|
// See if the Virtual Machine wasn't already destroyed
|
||||||
if (m_VM != nullptr)
|
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);
|
sq_close(m_VM);
|
||||||
|
// Set the virtual machine to null
|
||||||
m_VM = nullptr;
|
m_VM = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user