Skip to content
Snippets Groups Projects
Commit bdefdfd7 authored by rswindell's avatar rswindell
Browse files

Fix bug where-by a js.on_exit() evaluation string is terminated after its first

loop because the termination (e.g. dropped TCP session) flag is set:
Disable the auto-termination when evaluting on-exit strings.
parent ab489f5d
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2006 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -425,6 +425,8 @@ void DLLCALL js_EvalOnExit(JSContext *cx, JSObject *obj, js_branch_t* branch)
jsval rval;
JSScript* script;
branch->auto_terminate=false;
while((p=strListPop(&branch->exit_func))!=NULL) {
if((script=JS_CompileScript(cx, obj, p, strlen(p), NULL, 0))!=NULL) {
JS_ExecuteScript(cx, obj, script, &rval);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment