aboutsummaryrefslogtreecommitdiff
path: root/lib/std/debug.zig
diff options
context:
space:
mode:
authorkcbanner <kcbanner@gmail.com>2023-01-08 22:16:16 -0500
committerkcbanner <kcbanner@gmail.com>2023-01-08 22:16:16 -0500
commit5e3cadf871ab800d90c85f39cc28b922539d4dbf (patch)
treea15db66aff93574b4a0e909e8ade31cc1f55ac25 /lib/std/debug.zig
parent461fb499f3cff9038a427eae120fb34defc9ab38 (diff)
downloadzig-5e3cadf871ab800d90c85f39cc28b922539d4dbf.tar.gz
zig-5e3cadf871ab800d90c85f39cc28b922539d4dbf.zip
debug: fixup memory management
Diffstat (limited to 'lib/std/debug.zig')
-rw-r--r--lib/std/debug.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig
index 55072b6363..4d9907672d 100644
--- a/lib/std/debug.zig
+++ b/lib/std/debug.zig
@@ -838,7 +838,7 @@ pub fn openSelfDebugInfo(allocator: mem.Allocator) OpenSelfDebugInfoError!DebugI
fn readCoffDebugInfo(allocator: mem.Allocator, coff_bytes: []const u8) !ModuleDebugInfo {
nosuspend {
const coff_obj = try allocator.create(coff.Coff);
- errdefer allocator.destroy(coff_obj);
+ defer allocator.destroy(coff_obj);
coff_obj.* = try coff.Coff.init(coff_bytes);
var di = ModuleDebugInfo{
@@ -1289,6 +1289,7 @@ pub const DebugInfo = struct {
self.allocator.destroy(mdi);
}
self.address_map.deinit();
+ if (native_os == .windows) self.modules.deinit(self.allocator);
}
pub fn getModuleForAddress(self: *DebugInfo, address: usize) !*ModuleDebugInfo {