From 65eb6db7fae3e43f095a74618a8366698b646744 Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Tue, 9 May 2023 15:29:32 -0700 Subject: Fix a memory leak in module resolution --- src/linker.zig | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/linker.zig') diff --git a/src/linker.zig b/src/linker.zig index 6c5e0e50b..6786f8711 100644 --- a/src/linker.zig +++ b/src/linker.zig @@ -988,12 +988,7 @@ pub const Linker = struct { comptime import_path_format: Options.BundleOptions.ImportPathFormat, ) !void { linker.import_counter += 1; - // lazy means: - // Run the resolver - // Don't parse/print automatically. - if (linker.options.resolve_mode != .lazy) { - _ = try linker.enqueueResolveResult(resolve_result); - } + const path = resolve_result.pathConst() orelse unreachable; import_record.path = try linker.generateImportPath( @@ -1007,6 +1002,9 @@ pub const Linker = struct { switch (loader) { .css => { + if (!linker.options.target.isBun()) + _ = try linker.enqueueResolveResult(resolve_result); + if (linker.onImportCSS) |callback| { callback(resolve_result, import_record, origin); } -- cgit v1.2.3