File tree 1 file changed +6
-7
lines changed
1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -42,18 +42,17 @@ class Program final {
42
42
Program (Context &Ctx) : Ctx(Ctx) {}
43
43
44
44
~Program () {
45
+ // Manually destroy all the blocks. They are almost all harmless,
46
+ // but primitive arrays might have an InitMap* heap allocated and
47
+ // that needs to be freed.
48
+ for (Global *G : Globals)
49
+ G->block ()->invokeDtor ();
50
+
45
51
// Records might actually allocate memory themselves, but they
46
52
// are allocated using a BumpPtrAllocator. Call their desctructors
47
53
// here manually so they are properly freeing their resources.
48
54
for (auto RecordPair : Records)
49
55
RecordPair.second ->~Record ();
50
-
51
- // Manually destroy all the blocks. They are almost all harmless,
52
- // but primitive arrays might have an InitMap* heap allocated and
53
- // that needs to be freed.
54
- for (Global *G : Globals) {
55
- G->block ()->invokeDtor ();
56
- }
57
56
}
58
57
59
58
// / Marshals a native pointer to an ID for embedding in bytecode.
You can’t perform that action at this time.
0 commit comments