Skip to content

Commit 717657a

Browse files
committed
test
1 parent 3db4874 commit 717657a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/streams.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ static JSValue tjs_new_tcp(JSContext *ctx, int af);
3636

3737
typedef struct {
3838
JSContext *ctx;
39+
JSRuntime *rt;
3940
int closed;
4041
int finalized;
4142
union {
@@ -82,7 +83,7 @@ static void uv__stream_close_cb(uv_handle_t *handle) {
8283
CHECK_NOT_NULL(s);
8384
s->closed = 1;
8485
if (s->finalized)
85-
js_free(s->ctx, s);
86+
js_free_rt(s->rt, s);
8687
}
8788

8889
static void maybe_close(TJSStream *s) {
@@ -399,6 +400,7 @@ static JSValue tjs_stream_set_blocking(JSContext *ctx, TJSStream *s, int argc, J
399400

400401
static JSValue tjs_init_stream(JSContext *ctx, JSValue obj, TJSStream *s) {
401402
s->ctx = ctx;
403+
s->rt = JS_GetRuntime(ctx);
402404
s->closed = 0;
403405
s->finalized = 0;
404406

src/vm.c

+1
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ TJSRuntime *TJS_NewRuntimeInternal(bool is_worker, TJSRunOptions *options) {
228228
}
229229

230230
void TJS_FreeRuntime(TJSRuntime *qrt) {
231+
JS_FreeValue(qrt->ctx, JS_GetException(qrt->ctx));
231232
JS_FreeContext(qrt->ctx);
232233
qrt->ctx = NULL;
233234
JS_RunGC(qrt->rt);

0 commit comments

Comments
 (0)