Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
saghul committed Feb 29, 2024
1 parent db7e5f2 commit 1556cac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ typedef struct {

typedef struct {
JSContext *ctx;
JSRuntime *rt;
union {
uv_handle_t handle;
uv_stream_t stream;
Expand Down Expand Up @@ -131,7 +132,7 @@ static void worker_entry(void *arg) {
static void uv__close_cb(uv_handle_t *handle) {
TJSWorker *w = handle->data;
CHECK_NOT_NULL(w);
js_free(w->ctx, w);
js_free_rt(w->rt, w);
}

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

w->ctx = ctx;
w->rt = JS_GetRuntime(ctx);
w->is_main = is_main;
w->h.handle.data = w;

Expand Down

0 comments on commit 1556cac

Please sign in to comment.