diff options
author | 2023-05-09 15:29:32 -0700 | |
---|---|---|
committer | 2023-05-09 15:29:32 -0700 | |
commit | 65eb6db7fae3e43f095a74618a8366698b646744 (patch) | |
tree | ca2cbca07381fff63a2a0a113b7ad724acd3af0d /src/linker.zig | |
parent | ce3c7d296153dbb47c5a9cfbab2d5551825c5080 (diff) | |
download | bun-65eb6db7fae3e43f095a74618a8366698b646744.tar.gz bun-65eb6db7fae3e43f095a74618a8366698b646744.tar.zst bun-65eb6db7fae3e43f095a74618a8366698b646744.zip |
Fix a memory leak in module resolution
Diffstat (limited to 'src/linker.zig')
-rw-r--r-- | src/linker.zig | 10 |
1 files changed, 4 insertions, 6 deletions
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); } |