| ... | @@ -1948,8 +1948,9 @@ pub fn update(comp: *Compilation, main_progress_node: *std.Progress.Node) !void | ... | @@ -1948,8 +1948,9 @@ pub fn update(comp: *Compilation, main_progress_node: *std.Progress.Node) !void |
| 1948 | .sub_path = std.fs.path.basename(sub_path), | 1948 | .sub_path = std.fs.path.basename(sub_path), |
| 1949 | }; | 1949 | }; |
| 1950 | } | 1950 | } |
| 1951 | comp.bin_file.destroy(); | 1951 | var old_bin_file = comp.bin_file; |
| 1952 | comp.bin_file = try link.File.openPath(comp.gpa, options); | 1952 | comp.bin_file = try link.File.openPath(comp.gpa, options); |
| | 1953 | old_bin_file.destroy(); |
| 1953 | } | 1954 | } |
| 1954 | | 1955 | |
| 1955 | // For compiling C objects, we rely on the cache hash system to avoid duplicating work. | 1956 | // For compiling C objects, we rely on the cache hash system to avoid duplicating work. |