thmap icon indicating copy to clipboard operation
thmap copied to clipboard

thmap_destroy of non-empty tree

Open nuclight opened this issue 2 months ago • 2 comments

In using like a hashmap, a need may be possible to destroy the tree without first deleting all entries, in situations when "foreach" or sibling access is not needed. Then, looking at code, I guess it will just leak all nodes. An obvious "solution" of linked list may incur too much memory overhead. Could destroy() just iterate all nodes internally and free them?

nuclight avatar Oct 19 '25 01:10 nuclight