mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-06-15 22:57:12 +02:00
Introduce a new module event to be called after the virtual machine was destroyed. Thus, preventing the release of the virtual machine while still in use.
Prevent releasing IRC sessions while they could still be in use. Few other changes that had to be committed because of the change in the module API.
This commit is contained in:
@ -85,6 +85,13 @@ void OnSquirrelTerminate()
|
||||
NullTable().Release();
|
||||
NullArray().Release();
|
||||
NullFunction().ReleaseGently();
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* The virtual machined was closed and all memory associated with it was released.
|
||||
*/
|
||||
void OnSquirrelReleased()
|
||||
{
|
||||
// Release the current virtual machine, if any
|
||||
DefaultVM::Set(nullptr);
|
||||
}
|
||||
@ -127,6 +134,9 @@ static uint8_t OnPluginCommand(uint32_t command_identifier, CCStr message)
|
||||
case SQMOD_TERMINATE_CMD:
|
||||
OnSquirrelTerminate();
|
||||
break;
|
||||
case SQMOD_RELEASED_CMD:
|
||||
OnSquirrelReleased();
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
return 1;
|
||||
|
Reference in New Issue
Block a user