Commit d4b87665 authored by deuce's avatar deuce
Browse files

Destroy JS_DestroyScript() usage.

parent afd49a5e
......@@ -1017,9 +1017,6 @@ BOOL js_generate_index(JSContext* js_cx, JSObject* parent,
} while(0);
if(js_script!=NULL)
JS_DestroyScript(js_cx, js_script);
JS_DeleteProperty(js_cx, parent, "path");
JS_DeleteProperty(js_cx, parent, "sort");
JS_DeleteProperty(js_cx, parent, "reverse");
......
......@@ -128,7 +128,6 @@ static void background_thread(void* arg)
result=exit_code;
js_EvalOnExit(bg->cx, bg->obj, &bg->branch);
js_enqueue_value(bg->cx, bg->msg_queue, result, NULL);
JS_DestroyScript(bg->cx, bg->script);
JS_ENDREQUEST(bg->cx);
JS_DestroyContext(bg->cx);
jsrt_Release(bg->runtime);
......@@ -481,7 +480,6 @@ js_load(JSContext *cx, uintN argc, jsval *arglist)
success = JS_ExecuteScript(exec_cx, exec_obj, script, &rval);
JS_SET_RVAL(cx, arglist, rval);
JS_DestroyScript(exec_cx, script);
}
return(success);
......
......@@ -312,7 +312,6 @@ js_eval(JSContext *parent_cx, uintN argc, jsval *arglist)
jsval rval;
JS_ExecuteScript(cx, obj, script, &rval);
JS_DestroyScript(cx, script);
JS_SET_RVAL(cx, arglist, rval);
}
......@@ -475,7 +474,6 @@ void DLLCALL js_EvalOnExit(JSContext *cx, JSObject *obj, js_branch_t* branch)
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);
JS_DestroyScript(cx, script);
}
free(p);
}
......
......@@ -935,8 +935,6 @@ long js_exec(const char *fname, char** args)
,path
,diff);
JS_DestroyScript(js_cx, js_script);
JS_GC(js_cx);
if(js_buf!=NULL)
......
......@@ -1902,8 +1902,6 @@ js_mailproc(SOCKET sock, client_t* client, user_t* user, struct mailproc* mailpr
JS_GetProperty(*js_cx, *js_glob, "exit_code", &rval);
JS_DestroyScript(*js_cx, js_script);
JS_ClearScope(*js_cx, js_scope);
JS_GC(*js_cx);
......
......@@ -1209,7 +1209,6 @@ static void js_service_thread(void* arg)
#endif
JS_ExecuteScript(js_cx, js_glob, js_script, &rval);
js_EvalOnExit(js_cx, js_glob, &service_client.branch);
JS_DestroyScript(js_cx, js_script);
}
JS_ENDREQUEST(js_cx);
JS_DestroyContext(js_cx); /* Free Context */
......@@ -1319,7 +1318,6 @@ static void js_static_service_thread(void* arg)
js_PrepareToExecute(js_cx, js_glob, spath, /* startup_dir */NULL);
JS_ExecuteScript(js_cx, js_glob, js_script, &rval);
js_EvalOnExit(js_cx, js_glob, &service_client.branch);
JS_DestroyScript(js_cx, js_script);
JS_ENDREQUEST(js_cx);
JS_DestroyContext(js_cx); /* Free Context */
......
......@@ -4672,8 +4672,6 @@ static BOOL exec_ssjs(http_session_t* session, char* script) {
/* Free up temporary resources here */
if(js_script!=NULL)
JS_DestroyScript(session->js_cx, js_script);
session->req.dynamic=IS_SSJS;
JS_ENDREQUEST(session->js_cx);
......
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