diff options
author | 2023-09-07 21:07:00 -0800 | |
---|---|---|
committer | 2023-09-07 21:07:00 -0800 | |
commit | 822a00c4d508b54f650933a73ca5f4a3af9a7983 (patch) | |
tree | 8c0d1e7ce7e9c230f97bcc17c3169647267b1eec /src/bun.js/webcore/streams.zig | |
parent | f6a621f36a87d54d14e2b2ea81c1bcef4906ae63 (diff) | |
download | bun-v1.0.0.tar.gz bun-v1.0.0.tar.zst bun-v1.0.0.zip |
Fix a couple important bugs (#4560)bun-v1.0.0
Diffstat (limited to 'src/bun.js/webcore/streams.zig')
-rw-r--r-- | src/bun.js/webcore/streams.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bun.js/webcore/streams.zig b/src/bun.js/webcore/streams.zig index f40548eb8..a578313d7 100644 --- a/src/bun.js/webcore/streams.zig +++ b/src/bun.js/webcore/streams.zig @@ -109,7 +109,6 @@ pub const ReadableStream = struct { blob.size = blobby.remain; blob.store.?.ref(); stream.detachIfPossible(globalThis); - blobby.deinit(); return AnyBlob{ .Blob = blob }; }, @@ -120,7 +119,6 @@ pub const ReadableStream = struct { // it should be lazy, file shouldn't have opened yet. std.debug.assert(!blobby.started); stream.detachIfPossible(globalThis); - blobby.deinit(); return AnyBlob{ .Blob = blob }; } }, @@ -131,6 +129,8 @@ pub const ReadableStream = struct { if (bytes.has_received_last_chunk) { var blob: JSC.WebCore.AnyBlob = undefined; blob.from(bytes.buffer); + bytes.buffer.items = &.{}; + bytes.buffer.capacity = 0; stream.detachIfPossible(globalThis); return blob; } |