From 8479d84cef9871c8554b872434bcfa6490483a32 Mon Sep 17 00:00:00 2001 From: Balakrishna Avulapati Date: Fri, 18 Sep 2026 18:40:58 +0530 Subject: [PATCH] Retire the IPC poll before closing its loop --- test/shared/worklet-ipc-large-write.c | 6 ++++-- test/shared/worklet-ipc.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/test/shared/worklet-ipc-large-write.c b/test/shared/worklet-ipc-large-write.c index 803ba00..57b11ec 100644 --- a/test/shared/worklet-ipc-large-write.c +++ b/test/shared/worklet-ipc-large-write.c @@ -103,14 +103,16 @@ main() { err = uv_run(loop, UV_RUN_DEFAULT); assert(err == 0); + // Before the loop closes: the worklet's exit makes this end readable, and the + // poll's callback posts to this loop. + bare_ipc_poll_destroy(&poll); + err = uv_loop_close(loop); assert(err == 0); err = bare_worklet_terminate(&worklet); assert(err == 0); - bare_ipc_poll_destroy(&poll); - bare_ipc_destroy(&ipc); bare_worklet_destroy(&worklet); diff --git a/test/shared/worklet-ipc.c b/test/shared/worklet-ipc.c index 667508d..26b0e1c 100644 --- a/test/shared/worklet-ipc.c +++ b/test/shared/worklet-ipc.c @@ -138,14 +138,16 @@ main() { assert(err == 0); } + // Before the loop closes: the worklet's exit makes this end readable, and the + // poll's callback posts to this loop. + bare_ipc_poll_destroy(&poll); + err = uv_loop_close(loop); assert(err == 0); err = bare_worklet_terminate(&worklet); assert(err == 0); - bare_ipc_poll_destroy(&poll); - bare_ipc_destroy(&ipc); bare_worklet_destroy(&worklet);