mirror of
https://github.com/ziglang/zig.git
synced 2025-12-30 01:53:16 +00:00
macho: properly close file handles owned by the linker in deinit()
This commit is contained in:
parent
215fce8c51
commit
8ef1c62f2e
@ -3013,6 +3013,7 @@ pub fn deinit(self: *MachO) void {
|
||||
}
|
||||
|
||||
if (self.d_sym) |*d_sym| {
|
||||
d_sym.file.close();
|
||||
d_sym.deinit(gpa);
|
||||
}
|
||||
|
||||
@ -3041,6 +3042,7 @@ pub fn deinit(self: *MachO) void {
|
||||
self.objects.deinit(gpa);
|
||||
|
||||
for (self.archives.items) |*archive| {
|
||||
archive.file.close();
|
||||
archive.deinit(gpa);
|
||||
}
|
||||
self.archives.deinit(gpa);
|
||||
@ -3086,15 +3088,6 @@ pub fn deinit(self: *MachO) void {
|
||||
self.atom_by_index_table.deinit(gpa);
|
||||
}
|
||||
|
||||
pub fn closeFiles(self: MachO) void {
|
||||
for (self.archives.items) |archive| {
|
||||
archive.file.close();
|
||||
}
|
||||
if (self.d_sym) |ds| {
|
||||
ds.file.close();
|
||||
}
|
||||
}
|
||||
|
||||
fn freeAtom(self: *MachO, atom: *Atom, sect_id: u8, owns_atom: bool) void {
|
||||
log.debug("freeAtom {*}", .{atom});
|
||||
if (!owns_atom) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user