Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 6f92ae8

Browse files
committed
[[ Bug 19994 ]] Clear substacks in destroystack
Prevously substacks were not being cleared correctly when the startup stack was destroyed and therefore substacks that were referenced were not cleanly removed.
1 parent 014a2e9 commit 6f92ae8

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

docs/notes/bugfix-19994.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Ensure startup stack substacks are cleanly removed from memory

engine/src/dispatch.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,12 @@ void MCDispatch::destroystack(MCStack *sptr, Boolean needremove)
363363
{
364364
if (needremove)
365365
{
366+
MCStack *t_substacks = sptr -> getsubstacks();
367+
while (t_substacks)
368+
{
369+
t_substacks -> dodel();
370+
t_substacks = sptr -> getsubstacks();
371+
}
366372
sptr -> dodel();
367373
}
368374
if (sptr == MCstaticdefaultstackptr)

0 commit comments

Comments
 (0)