Open GoogleCodeExporter opened 9 years ago
Yes, that is an interesting problem. Afaict, stuff should never be freed until
perhaps a new or open/close operation. After which it should be ok to go
through all
the items in treemap and delete them. This is a bit trick though because the
elements
point to other elements in weird ways. I was thinking a garbage collector would
be
the easiest way. Like in the HeeksObj constructor it would call some system
function,
like GC->New(this). Then the GC would have a pointer to all created objects.
Then
when you want to clean things up, you have to get a list of alive pointers
which can
be retrieved by descending the currently open tree, and the subtrees that
UndoEngine
has. The stuff that needs to be deleted is then the difference between these
lists.
Since the list is complete, there is no need to run any destructor code. Ie. no
deleting of children is necessary by the parents. This really circumvents alot
of the
problems involved with deleting DAGs via destructor.
Original comment by jonpry@gmail.com
on 28 Mar 2010 at 7:52
Original issue reported on code.google.com by
danhe...@gmail.com
on 27 Mar 2010 at 11:11