[Issue 12915] RedBlackTree leaks memory

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Jun 13 13:04:32 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=12915

--- Comment #4 from safety0ff.bugz <safety0ff.bugz at gmail.com> ---
(In reply to Steven Schveighoffer from comment #3)
> We certainly can null pointers as the nodes are deallocated. But the tree
> does not go through and destroy all the nodes if you just forget the tree
> (and I would argue it shouldn't).

Clear simply resets the begin & end pointers.

> So this may solve the specific use case, but not the general one.

The general case is only solved by precise GC.

We can only help specific use cases:
- Nulling on element removal.
- Manually specified complete destruction.
etc.

--


More information about the Digitalmars-d-bugs mailing list