diff options
author | 2023-04-25 21:47:42 -0700 | |
---|---|---|
committer | 2023-04-25 21:47:42 -0700 | |
commit | 6259dfdfd1a954f5e42314988fd58306cccc453c (patch) | |
tree | 8227356c3ed19bce717cc0c004d581cac7b7e715 /src/bun.js/webcore | |
parent | 0846a4fa809430a77f1284a7a526a946007484e0 (diff) | |
download | bun-6259dfdfd1a954f5e42314988fd58306cccc453c.tar.gz bun-6259dfdfd1a954f5e42314988fd58306cccc453c.tar.zst bun-6259dfdfd1a954f5e42314988fd58306cccc453c.zip |
Fix crash
Diffstat (limited to 'src/bun.js/webcore')
-rw-r--r-- | src/bun.js/webcore/request.zig | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bun.js/webcore/request.zig b/src/bun.js/webcore/request.zig index 854f7ff43..9a98dea99 100644 --- a/src/bun.js/webcore/request.zig +++ b/src/bun.js/webcore/request.zig @@ -68,6 +68,8 @@ pub const Request = struct { // We must report a consistent value for this reported_estimated_size: ?u63 = null, + finalization_callback: ?*JSC.FinalizationCallback = null, + const RequestMixin = BodyMixin(@This()); pub usingnamespace JSC.Codegen.JSRequest; @@ -279,6 +281,10 @@ pub const Request = struct { pub fn finalize(this: *Request) callconv(.C) void { this.finalizeWithoutDeinit(); + if (this.finalization_callback) |finalizer| { + var pool = JSC.VirtualMachine.get().finalizationPool(); + finalizer.call(pool); + } bun.default_allocator.destroy(this); } |