Kill Spectator PFEH when exiting spectator

Should fix #2989
There is a race condition between these 4 PFEH and the "onUnload" event
in handleInterface.
If the PFEHs run first they will use nil variables and throw a script
error.
This sets them to nil immediately when exiting spectator
This commit is contained in:
PabstMirror 2016-01-01 00:14:48 -06:00
parent 5f74daec42
commit 79a7bb54aa

View File

@ -127,6 +127,12 @@ if (_set) then {
GVAR(unitCamera) = nil; GVAR(unitCamera) = nil;
GVAR(targetCamera) = nil; GVAR(targetCamera) = nil;
//Kill these PFEH handlers now because the PFEH can run before the `onunload` event is handled
GVAR(camHandler) = nil;
GVAR(compHandler) = nil;
GVAR(iconHandler) = nil;
GVAR(toolHandler) = nil;
// Cleanup display variables // Cleanup display variables
GVAR(ctrlKey) = nil; GVAR(ctrlKey) = nil;
GVAR(heldKeys) = nil; GVAR(heldKeys) = nil;