Commit 4a099183 authored by rswindell's avatar rswindell
Browse files

Recompiles and destroys script for each static JS service loop.

parent 78ade3c1
...@@ -1014,22 +1014,25 @@ static void js_static_service_thread(void* arg) ...@@ -1014,22 +1014,25 @@ static void js_static_service_thread(void* arg)
val = BOOLEAN_TO_JSVAL(JS_FALSE); val = BOOLEAN_TO_JSVAL(JS_FALSE);
JS_SetProperty(js_cx, js_glob, "logged_in", &val); JS_SetProperty(js_cx, js_glob, "logged_in", &val);
JS_ClearPendingException(js_cx);
js_script=JS_CompileFile(js_cx, js_glob, spath); JS_SetBranchCallback(js_cx, js_BranchCallback);
do {
JS_ClearPendingException(js_cx);
if(js_script==NULL) js_script=JS_CompileFile(js_cx, js_glob, spath);
lprintf("%04d !JavaScript FAILED to compile script (%s)",service->socket,spath);
else {
JS_SetBranchCallback(js_cx, js_BranchCallback);
do { if(js_script==NULL) {
JS_ExecuteScript(js_cx, js_glob, js_script, &rval); lprintf("%04d !JavaScript FAILED to compile script (%s)",service->socket,spath);
JS_GC(js_cx); break;
} while(!service->terminated && service->options&SERVICE_OPT_STATIC_LOOP); }
JS_ExecuteScript(js_cx, js_glob, js_script, &rval);
JS_DestroyScript(js_cx, js_script); JS_DestroyScript(js_cx, js_script);
}
JS_GC(js_cx);
} while(!service->terminated && service->options&SERVICE_OPT_STATIC_LOOP);
JS_DestroyContext(js_cx); /* Free Context */ JS_DestroyContext(js_cx); /* Free Context */
JS_DestroyRuntime(js_runtime); JS_DestroyRuntime(js_runtime);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment