Skip to content

Commit f9c4cef

Browse files
committed
Update zig-js-runtime, wait for loop on wpt error
Updates zig-js-runtime to latest, reverting the loop reset change. This solves the introduced memory leak. On WPT error, call js_env.wait() to ensure all pending events are completed. Without this, on error, the code is likely to crash as the timeout callback executes AFTER env.deinit() is called. This is now possible to do safely on Mac now that cancel is pseudo-implemented.
1 parent d772eaf commit f9c4cef

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/wpt/run.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ pub fn run(arena: *std.heap.ArenaAllocator, comptime dir: []const u8, f: []const
7575
.renderer = &renderer,
7676
});
7777
defer js_env.deinit();
78+
errdefer js_env.wait() catch unreachable;
7879

7980
var storageShelf = storage.Shelf.init(alloc);
8081
defer storageShelf.deinit();

vendor/zig-js-runtime

0 commit comments

Comments
 (0)