Skip to content

Commit 6dbb85f

Browse files
committed
Fix macOS browser shutdown leak
1 parent 2118665 commit 6dbb85f

4 files changed

Lines changed: 5 additions & 131 deletions

File tree

CHANGELOG.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

MIGRATION.md

Lines changed: 0 additions & 102 deletions
This file was deleted.

docs/.keep

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/root/tests.zig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,11 @@ test "shutdown in webview mode terminates tracked browser child process" {
401401
try child.spawn();
402402
defer {
403403
core_runtime.terminateBrowserProcess(gpa.allocator(), @as(i64, @intCast(child.id)));
404-
_ = child.wait() catch {};
404+
// On macOS this test may already reap via waitpid(WNOHANG) while polling.
405+
// Avoid a second wait() call that would hit std.posix.waitpid(.CHILD).
406+
if (builtin.os.tag != .macos) {
407+
_ = child.wait() catch {};
408+
}
405409
}
406410

407411
const child_pid_i64: i64 = @as(i64, @intCast(child.id));

0 commit comments

Comments
 (0)