File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -42,18 +42,17 @@ class Program final {
4242 Program (Context &Ctx) : Ctx(Ctx) {}
4343
4444 ~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+
4551 // Records might actually allocate memory themselves, but they
4652 // are allocated using a BumpPtrAllocator. Call their desctructors
4753 // here manually so they are properly freeing their resources.
4854 for (auto RecordPair : Records)
4955 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- }
5756 }
5857
5958 // / Marshals a native pointer to an ID for embedding in bytecode.
You can’t perform that action at this time.
0 commit comments