There's more

This commit is contained in:
Jarred Sumner
2025-04-25 00:22:21 -07:00
parent c8126a2b47
commit 3f43dbcc80
4 changed files with 11 additions and 8 deletions

View File

@@ -1262,7 +1262,7 @@ pub const AsyncReaddirRecursiveTask = struct {
pub fn deinit(this: *AsyncReaddirRecursiveTask) void {
bun.assert(this.root_fd == bun.invalid_fd); // should already have closed it
if (this.pending_err) |*err| {
bun.default_allocator.free(err.path);
err.deinit();
}
this.ref.unref(this.globalObject.bunVM());

View File

@@ -998,6 +998,7 @@ pub const CopyFileWindows = struct {
const globalThis = this.event_loop.global;
const promise = this.promise.swap();
const err_instance = err.toJSC(globalThis);
var event_loop = this.event_loop;
event_loop.enter();
defer event_loop.exit();
@@ -1109,9 +1110,10 @@ pub const CopyFileWindows = struct {
fn onMkdirpComplete(this: *CopyFileWindows) void {
this.event_loop.unrefConcurrently();
if (this.err) |err| {
if (bun.take(&this.err)) |err| {
this.throw(err);
bun.default_allocator.free(err.path);
var err2 = err;
err2.deinit();
return;
}

View File

@@ -352,12 +352,12 @@ pub fn batchedMoveTaskDone(this: *Mv, task: *ShellMvBatchedTask) void {
var exec = &this.state.executing;
if (task.err) |err| {
if (task.err) |*err| {
exec.error_signal.store(true, .seq_cst);
if (exec.err == null) {
exec.err = err;
exec.err = err.*;
} else {
bun.default_allocator.free(err.path);
err.deinit();
}
}

View File

@@ -581,7 +581,8 @@ pub const ShellRmTask = struct {
this.task_manager.err = err;
this.task_manager.error_signal.store(true, .seq_cst);
} else {
bun.default_allocator.free(err.path);
var err2 = err;
err2.deinit();
}
},
.result => {},
@@ -596,7 +597,7 @@ pub const ShellRmTask = struct {
this.task_manager.err = err;
this.task_manager.error_signal.store(true, .seq_cst);
} else {
bun.default_allocator.free(err.path);
this.task_manager.err.?.deinit();
}
}