Skip to content
Snippets Groups Projects
Commit 9d752c75 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Install OperationCallback for all executed JS scripts

JS doors with the "Use Shell or New Context" option enabled in SCFG and JS
modules installed a global hot key handlers would not automatically terminate
when the user disconnected (and js.auto_terminate was true, the default).
I'm not sure why the operation callback was only installed when scope==NULL
but always installing it fixes the issue with some global hot key modules
and JS doors becoming "zombies" when a user disconnects while running them.
parent dee6266e
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2979 passed
......@@ -679,13 +679,8 @@ long sbbs_t::js_execfile(const char *cmd, const char* startup_dir, JSObject* sco
if(scope==NULL) {
js_callback.counter=0; // Reset loop counter
#if JS_VERSION>180
JS_SetOperationCallback(js_cx, js_OperationCallback);
#else
JS_SetBranchCallback(js_cx, js_BranchCallback);
#endif
}
JS_SetOperationCallback(js_cx, js_OperationCallback);
js_PrepareToExecute(js_cx, js_glob, path, startup_dir, js_scope);
events = js_callback.events;
js_callback.events = NULL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment