Skip to content

Commit cd9466d

Browse files
committed
free importmap on reset and don't retain capacity
1 parent 4bf79e4 commit cd9466d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/browser/ScriptManager.zig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ pub fn reset(self: *ScriptManager) void {
122122
self.sync_module_pool.destroy(value_ptr.*);
123123
}
124124
self.sync_modules.clearRetainingCapacity();
125-
self.importmap.clearRetainingCapacity();
125+
// Our allocator is the page arena, it's been reset. We cannot use
126+
// clearAndRetainCapacity, since that space is no longer ours
127+
self.importmap.clearAndFree(self.page.arena);
126128

127129
self.clearList(&self.asyncs);
128130
self.clearList(&self.scripts);

0 commit comments

Comments
 (0)