vm: tick any remaining tasks before exit

This commit is contained in:
Meghan Denny
2025-09-29 21:44:28 -07:00
committed by GitHub
parent 621066d0c4
commit 40e2bc1389

View File

@@ -834,6 +834,7 @@ extern fn Zig__GlobalObject__destructOnExit(*JSGlobalObject) void;
pub fn globalExit(this: *VirtualMachine) noreturn {
bun.assert(this.isShuttingDown());
this.eventLoop().tick();
if (this.shouldDestructMainThreadOnExit()) {
if (this.eventLoop().forever_timer) |t| t.deinit(true);
Zig__GlobalObject__destructOnExit(this.global);