diff --git a/src/task.c b/src/task.c index 05cd9f48..460d880a 100644 --- a/src/task.c +++ b/src/task.c @@ -926,7 +926,7 @@ void tf_task_on_receive_packet(int packetType, const char* begin, size_t length, } js_free(to->_context, ptab); - JS_SetPropertyStr(to->_context, global, "imports", imports); + JS_FreeValue(to->_context, imports); JS_FreeValue(to->_context, global); } break; diff --git a/src/taskstub.js.c b/src/taskstub.js.c index 58c6cf6d..c0d67092 100644 --- a/src/taskstub.js.c +++ b/src/taskstub.js.c @@ -112,9 +112,7 @@ static JSValue _taskstub_create(JSContext* context, JSValueConst this_val, int a JS_SetPropertyStr(context, taskObject, "activate", JS_NewCFunction(context, _taskstub_activate, "activate", 0)); JS_SetPropertyStr(context, taskObject, "execute", JS_NewCFunction(context, _taskstub_execute, "execute", 1)); - JSAtom imports = JS_NewAtom(context, "imports"); JS_SetPropertyStr(context, taskObject, "setImports", JS_NewCFunction(context, _taskstub_setImports, "setImports", 1)); - JS_FreeAtom(context, imports); JS_SetPropertyStr(context, taskObject, "getExports", JS_NewCFunction(context, _taskstub_getExports, "getExports", 0)); JS_SetPropertyStr(context, taskObject, "setRequires", JS_NewCFunction(context, _taskstub_setRequires, "setRequires", 1)); JS_SetPropertyStr(context, taskObject, "kill", JS_NewCFunction(context, _taskstub_kill, "kill", 0));