jermaine-clarke / lindenmayer

A python implementation of an L-system engine
GNU General Public License v3.0
0 stars 0 forks source link

ModuleTree memory leak #2

Open jermaine-clarke opened 2 months ago

jermaine-clarke commented 2 months ago

Dropping siblings that have children will leave an orphaned but self-referential sub-tree. This sub-tree will not be garbage collected. This occurs because a parent node points to the first child in a linked list of children who each in turn point to the parent.

jermaine-clarke commented 2 months ago

Possible solution is to scrap the ModuleTree in favour of a flat linked list. This would require another way to store the history of the string.