From 78474e0bea17f29f409a6eb757abc43cee624e4b Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sat, 6 Dec 2025 13:01:23 -0500 Subject: [PATCH] ios: Fix crashes transitioning between apps in one process mode. --- src/taskstub.js.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/taskstub.js.c b/src/taskstub.js.c index ab199c81..49ad999c 100644 --- a/src/taskstub.js.c +++ b/src/taskstub.js.c @@ -102,14 +102,13 @@ static void _tf_taskstub_on_exit(tf_taskstub_t* stub, int64_t status, int termin tf_packetstream_destroy(stub->_stream); stub->_stream = NULL; } - tf_task_remove_child(stub->_owner, stub); if (stub->_process.data) { uv_close((uv_handle_t*)&stub->_process, _taskstub_on_handle_close); } else { - _taskstub_cleanup(stub); + tf_task_remove_child(stub->_owner, stub); } } @@ -205,9 +204,9 @@ static JSValue _taskstub_create(JSContext* context, JSValueConst this_val, int a } else { - /* XXX: This is a leak. */ - uv_thread_t* thread = tf_malloc(sizeof(uv_thread_t)); - uv_thread_create(thread, _tf_taskstub_run_sandbox_thread, (void*)(intptr_t)fds[1]); + uv_thread_t thread = 0; + uv_thread_create(&thread, _tf_taskstub_run_sandbox_thread, (void*)(intptr_t)fds[1]); + uv_thread_detach(&thread); } tf_packetstream_set_on_receive(stub->_stream, tf_task_on_receive_packet, stub);