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

Revert "Don't call JS_GC() after js.exec() until new background threads exit"

This reverts commit ed8c30da.
parent 02e9b75c
No related branches found
No related tags found
No related merge requests found
Pipeline #7923 passed
......@@ -531,7 +531,6 @@ js_OperationCallback(JSContext *cx)
return ret;
}
extern JSClass js_global_class; // Hurr derr
int sbbs_t::js_execfile(const char *cmd, const char* startup_dir, JSObject* scope, JSContext* js_cx, JSObject* js_glob)
{
char* p;
......@@ -555,10 +554,7 @@ int sbbs_t::js_execfile(const char *cmd, const char* startup_dir, JSObject* scop
struct js_runq_entry * rq_head;
struct js_runq_entry * rq_tail;
struct js_listener_entry *listeners;
global_private_t *gptp;
if ((gptp = (global_private_t*)js_GetClassPrivate(js_cx, js_glob, &js_global_class)) == NULL)
return -1;
if (js_cx == NULL)
js_cx = this->js_cx;
......@@ -698,8 +694,6 @@ int sbbs_t::js_execfile(const char *cmd, const char* startup_dir, JSObject* scop
js_callback.rq_tail = NULL;
listeners = js_callback.listeners;
js_callback.listeners = NULL;
unsigned orig_bgcount = gptp->bg_count;
if (!JS_ExecuteScript(js_cx, js_scope, js_script, &rval))
result = -1;
js_handle_events(js_cx, &js_callback, &terminated);
......@@ -748,10 +742,6 @@ int sbbs_t::js_execfile(const char *cmd, const char* startup_dir, JSObject* scop
JS_RemoveValueRoot(js_cx, &old_js_exec_path);
JS_RemoveValueRoot(js_cx, &old_js_scope);
}
while (gptp->bg_count > orig_bgcount) {
if (sem_wait(&gptp->bg_sem) == 0)
gptp->bg_count--;
}
JS_GC(js_cx);
......
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