free importmap on reset and don't retain capacity

This commit is contained in:
Pierre Tachoire committed 2025-10-09 16:30:29 +02:00
1 parent 4bf79e4bc9
commit cd9466dafa
1 file changed
+3 -1
+3 -1
View File
@@ -122,7 +122,9 @@ pub fn reset(self: *ScriptManager) void {
self.sync_module_pool.destroy(value_ptr.*);
}
self.sync_modules.clearRetainingCapacity();
self.importmap.clearRetainingCapacity();
// Our allocator is the page arena, it's been reset. We cannot use
// clearAndRetainCapacity, since that space is no longer ours
self.importmap.clearAndFree(self.page.arena);
self.clearList(&self.asyncs);
self.clearList(&self.scripts);