stage2: fix memory leak in the cbe
This commit is contained in:
committed by
Veikka Tuominen
parent
30ffa052f2
commit
d9e46a4b90
@@ -92,6 +92,12 @@ pub fn updateDecl(self: *C, module: *Module, decl: *Module.Decl) !void {
|
||||
const typedefs = &decl.fn_link.c.typedefs;
|
||||
const code = &decl.link.c.code;
|
||||
fwd_decl.shrinkRetainingCapacity(0);
|
||||
{
|
||||
var it = typedefs.iterator();
|
||||
while (it.next()) |entry| {
|
||||
module.gpa.free(entry.value.rendered);
|
||||
}
|
||||
}
|
||||
typedefs.clearRetainingCapacity();
|
||||
code.shrinkRetainingCapacity(0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user