| ... | @@ -487,11 +487,13 @@ pub const Module = struct { | ... | @@ -487,11 +487,13 @@ pub const Module = struct { |
| 487 | .loaded_success => { | 487 | .loaded_success => { |
| 488 | allocator.free(self.source.bytes); | 488 | allocator.free(self.source.bytes); |
| 489 | self.contents.module.deinit(allocator); | 489 | self.contents.module.deinit(allocator); |
| | 490 | allocator.destroy(self.contents.module); |
| 490 | self.status = .unloaded_success; | 491 | self.status = .unloaded_success; |
| 491 | }, | 492 | }, |
| 492 | .loaded_sema_failure => { | 493 | .loaded_sema_failure => { |
| 493 | allocator.free(self.source.bytes); | 494 | allocator.free(self.source.bytes); |
| 494 | self.contents.module.deinit(allocator); | 495 | self.contents.module.deinit(allocator); |
| | 496 | allocator.destroy(self.contents.module); |
| 495 | self.status = .unloaded_sema_failure; | 497 | self.status = .unloaded_sema_failure; |
| 496 | }, | 498 | }, |
| 497 | .loaded_parse_failure => { | 499 | .loaded_parse_failure => { |
| ... | @@ -603,7 +605,14 @@ pub const Module = struct { | ... | @@ -603,7 +605,14 @@ pub const Module = struct { |
| 603 | } | 605 | } |
| 604 | self.failed_exports.deinit(); | 606 | self.failed_exports.deinit(); |
| 605 | } | 607 | } |
| 606 | self.decl_exports.deinit(); | 608 | { |
| | 609 | var it = self.decl_exports.iterator(); |
| | 610 | while (it.next()) |kv| { |
| | 611 | const export_list = kv.value; |
| | 612 | allocator.free(export_list); |
| | 613 | } |
| | 614 | self.decl_exports.deinit(); |
| | 615 | } |
| 607 | { | 616 | { |
| 608 | var it = self.export_owners.iterator(); | 617 | var it = self.export_owners.iterator(); |
| 609 | while (it.next()) |kv| { | 618 | while (it.next()) |kv| { |
| ... | @@ -613,7 +622,7 @@ pub const Module = struct { | ... | @@ -613,7 +622,7 @@ pub const Module = struct { |
| 613 | } | 622 | } |
| 614 | allocator.free(export_list); | 623 | allocator.free(export_list); |
| 615 | } | 624 | } |
| 616 | self.failed_exports.deinit(); | 625 | self.export_owners.deinit(); |
| 617 | } | 626 | } |
| 618 | self.root_pkg.destroy(); | 627 | self.root_pkg.destroy(); |
| 619 | { | 628 | { |