Skip to content

Commit 1556cac

Browse files
committed
WIP
1 parent db7e5f2 commit 1556cac

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/worker.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ typedef struct {
5050

5151
typedef struct {
5252
JSContext *ctx;
53+
JSRuntime *rt;
5354
union {
5455
uv_handle_t handle;
5556
uv_stream_t stream;
@@ -131,7 +132,7 @@ static void worker_entry(void *arg) {
131132
static void uv__close_cb(uv_handle_t *handle) {
132133
TJSWorker *w = handle->data;
133134
CHECK_NOT_NULL(w);
134-
js_free(w->ctx, w);
135+
js_free_rt(w->rt, w);
135136
}
136137

137138
static void tjs_worker_finalizer(JSRuntime *rt, JSValue val) {
@@ -234,6 +235,7 @@ static JSValue tjs_new_worker(JSContext *ctx, uv_os_sock_t channel_fd, bool is_m
234235
}
235236

236237
w->ctx = ctx;
238+
w->rt = JS_GetRuntime(ctx);
237239
w->is_main = is_main;
238240
w->h.handle.data = w;
239241

0 commit comments

Comments
 (0)