Skip to content

Commit 421fbd9

Browse files
authored
thread: don't leak the thread in spawnManager (#21379)
1 parent 8ec68c6 commit 421fbd9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/std/Thread/WaitGroup.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,6 @@ pub fn spawnManager(
6363
}
6464
};
6565
wg.start();
66-
_ = std.Thread.spawn(.{}, Manager.run, .{ wg, args }) catch Manager.run(wg, args);
66+
const t = std.Thread.spawn(.{}, Manager.run, .{ wg, args }) catch return Manager.run(wg, args);
67+
t.detach();
6768
}

0 commit comments

Comments
 (0)