set flag to allow forced unload of a running VM
required to prevent a client from exiting if the server disconnects (bug 3585)
This commit is contained in:
parent
8bcb33892e
commit
43ac1eca6a
3 changed files with 21 additions and 2 deletions
|
@ -40,6 +40,9 @@ vm_t *currentVM = NULL;
|
|||
vm_t *lastVM = NULL;
|
||||
int vm_debugLevel;
|
||||
|
||||
// used by Com_Error to get rid of running vm's before longjmp
|
||||
static int forced_unload;
|
||||
|
||||
#define MAX_VM 3
|
||||
vm_t vmTable[MAX_VM];
|
||||
|
||||
|
@ -613,8 +616,12 @@ void VM_Free( vm_t *vm ) {
|
|||
}
|
||||
|
||||
if(vm->callLevel) {
|
||||
Com_Error( ERR_FATAL, "VM_Free(%s) on running vm", vm->name );
|
||||
return;
|
||||
if(!forced_unload) {
|
||||
Com_Error( ERR_FATAL, "VM_Free(%s) on running vm", vm->name );
|
||||
return;
|
||||
} else {
|
||||
Com_Printf( "forcefully unloading %s vm\n", vm->name );
|
||||
}
|
||||
}
|
||||
|
||||
if(vm->destroy)
|
||||
|
@ -648,6 +655,14 @@ void VM_Clear(void) {
|
|||
}
|
||||
}
|
||||
|
||||
void VM_Forced_Unload_Start(void) {
|
||||
forced_unload = 1;
|
||||
}
|
||||
|
||||
void VM_Forced_Unload_Done(void) {
|
||||
forced_unload = 0;
|
||||
}
|
||||
|
||||
void *VM_ArgPtr( intptr_t intValue ) {
|
||||
if ( !intValue ) {
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue