From 995efd57e62730728d4c169ee14e4edd4b3ce4a8 Mon Sep 17 00:00:00 2001 From: Karl Seguin Date: Fri, 5 Jun 2026 17:32:21 +0800 Subject: [PATCH] Fix two arena leaks The first is with WGS not flushing the deferring layer after its synchronous importScripts call, see: https://github.com/lightpanda-io/browser/pull/2329#discussion_r3271068955 The second is from the ability of an XHR request to be re-used. This was gated on a boolean, but the ordering means that the 1st requests' released gets blocked by the gate, and thus we're always 1 release short. The solution is to use a counter instead of a boolean. --- src/browser/tests/net/xhr.html | 32 +++++++++++++++++++ src/browser/tests/worker/defer-noop.js | 3 ++ .../tests/worker/fetch-defer-worker.js | 20 ++++++++++++ src/browser/tests/worker/worker.html | 18 +++++++++++ src/browser/webapi/WorkerGlobalScope.zig | 2 ++ src/browser/webapi/net/XMLHttpRequest.zig | 11 ++++--- 6 files changed, 82 insertions(+), 4 deletions(-) create mode 100644 src/browser/tests/worker/defer-noop.js create mode 100644 src/browser/tests/worker/fetch-defer-worker.js diff --git a/src/browser/tests/net/xhr.html b/src/browser/tests/net/xhr.html index 3b23348d..fff72d38 100644 --- a/src/browser/tests/net/xhr.html +++ b/src/browser/tests/net/xhr.html @@ -431,6 +431,38 @@ } + + + +