free importmap on reset and don't retain capacity

This commit is contained in:
Pierre Tachoire
2025-10-09 16:21:55 +02:00
parent 4bf79e4bc9
commit cd9466dafa

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);