aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/webcore
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-04-25 21:47:42 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-04-25 21:47:42 -0700
commit6259dfdfd1a954f5e42314988fd58306cccc453c (patch)
tree8227356c3ed19bce717cc0c004d581cac7b7e715 /src/bun.js/webcore
parent0846a4fa809430a77f1284a7a526a946007484e0 (diff)
downloadbun-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.zig6
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);
}