| ... | @@ -2292,6 +2292,20 @@ pub const InnerError = error{ OutOfMemory, AnalysisFail }; | ... | @@ -2292,6 +2292,20 @@ pub const InnerError = error{ OutOfMemory, AnalysisFail }; |
| 2292 | pub fn deinit(mod: *Module) void { | 2292 | pub fn deinit(mod: *Module) void { |
| 2293 | const gpa = mod.gpa; | 2293 | const gpa = mod.gpa; |
| 2294 | | 2294 | |
| | 2295 | // The callsite of `Compilation.create` owns the `root_pkg`, however |
| | 2296 | // Module owns the builtin and std packages that it adds. |
| | 2297 | if (mod.root_pkg.table.remove("builtin")) |entry| { |
| | 2298 | gpa.free(entry.key); |
| | 2299 | entry.value.destroy(gpa); |
| | 2300 | } |
| | 2301 | if (mod.root_pkg.table.remove("std")) |entry| { |
| | 2302 | gpa.free(entry.key); |
| | 2303 | entry.value.destroy(gpa); |
| | 2304 | } |
| | 2305 | if (mod.root_pkg.table.remove("root")) |entry| { |
| | 2306 | gpa.free(entry.key); |
| | 2307 | } |
| | 2308 | |
| 2295 | mod.compile_log_text.deinit(gpa); | 2309 | mod.compile_log_text.deinit(gpa); |
| 2296 | | 2310 | |
| 2297 | mod.zig_cache_artifact_directory.handle.close(); | 2311 | mod.zig_cache_artifact_directory.handle.close(); |