Compare commits

...

2 Commits

Author SHA1 Message Date
Jarred Sumner
008a99013a coderabbit is correct 2025-09-27 22:03:38 -07:00
Jarred Sumner
b7d3f5a18e Fix 72 byte memory leak in worker destruction 2025-09-27 21:55:03 -07:00

View File

@@ -835,10 +835,7 @@ extern fn Zig__GlobalObject__destructOnExit(*JSGlobalObject) void;
pub fn globalExit(this: *VirtualMachine) noreturn {
bun.assert(this.isShuttingDown());
if (this.shouldDestructMainThreadOnExit()) {
if (this.eventLoop().forever_timer) |t| t.deinit(true);
Zig__GlobalObject__destructOnExit(this.global);
this.transpiler.deinit();
this.gc_controller.deinit();
this.deinit();
}
bun.Global.exit(this.exit_handler.exit_code);
@@ -1916,7 +1913,8 @@ pub fn processFetchLog(globalThis: *JSGlobalObject, specifier: bun.String, refer
}
pub fn deinit(this: *VirtualMachine) void {
this.auto_killer.deinit();
if (this.eventLoop().forever_timer) |t| t.deinit(true);
this.gc_controller.deinit();
if (source_code_printer) |print| {
print.getMutableBuffer().deinit();
@@ -1928,6 +1926,11 @@ pub fn deinit(this: *VirtualMachine) void {
}
this.overridden_main.deinit();
this.has_terminated = true;
if (this.is_main_thread) {
this.transpiler.deinit();
this.auto_killer.deinit();
}
}
pub const ExceptionList = std.ArrayList(api.JsException);