diff --git a/src/core/ev.c b/src/core/ev.c index 041c0bba..c447ef96 100644 --- a/src/core/ev.c +++ b/src/core/ev.c @@ -2519,9 +2519,9 @@ static JanetEVGenericMessage janet_go_thread_subr(JanetEVGenericMessage args) { args.argp = "failed to start thread"; } } + janet_restore(&tstate); janet_buffer_deinit(buffer); janet_free(buffer); - janet_restore(&tstate); janet_deinit(); return args; }