Skip to content

Commit f128576

Browse files
committed
maybe?
1 parent 14fad9b commit f128576

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/vm.c

+10-10
Original file line numberDiff line numberDiff line change
@@ -330,16 +330,6 @@ TJSRuntime *TJS_NewRuntimeInternal(bool is_worker, TJSRunOptions *options) {
330330
void TJS_FreeRuntime(TJSRuntime *qrt) {
331331
qrt->freeing = true;
332332

333-
/* Destroy CURLM handle. */
334-
if (qrt->curl_ctx.curlm_h) {
335-
curl_multi_cleanup(qrt->curl_ctx.curlm_h);
336-
qrt->curl_ctx.curlm_h = NULL;
337-
}
338-
339-
/* Destroy WASM runtime. */
340-
m3_FreeEnvironment(qrt->wasm_ctx.env);
341-
qrt->wasm_ctx.env = NULL;
342-
343333
/* Close all core loop handles. */
344334
uv_close((uv_handle_t *) &qrt->jobs.prepare, NULL);
345335
uv_close((uv_handle_t *) &qrt->jobs.idle, NULL);
@@ -360,6 +350,16 @@ void TJS_FreeRuntime(TJSRuntime *qrt) {
360350
JS_FreeContext(qrt->ctx);
361351
JS_FreeRuntime(qrt->rt);
362352

353+
/* Destroy CURLM handle. */
354+
if (qrt->curl_ctx.curlm_h) {
355+
curl_multi_cleanup(qrt->curl_ctx.curlm_h);
356+
qrt->curl_ctx.curlm_h = NULL;
357+
}
358+
359+
/* Destroy WASM runtime. */
360+
m3_FreeEnvironment(qrt->wasm_ctx.env);
361+
qrt->wasm_ctx.env = NULL;
362+
363363
/* Cleanup loop. All handles should be closed. */
364364
int closed = 0;
365365
for (int i = 0; i < 5; i++) {

0 commit comments

Comments
 (0)