mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
There's more
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user