GNOME Bugzilla – Bug 695045
TreeSet leaks references
Last modified: 2013-03-04 17:26:05 UTC
Attached is a sample program in Vala showing how Gee's TreeSet can leak references. The test contains a Counter class which counts the number of instances of itself that exist. The third test case demonstrates the bug -- a TreeSet goes out of scope without manually clearing the contents. Even though no other references to its contents exist, the counter indicates that they were never freed! One potential solution would be for TreeSet to add a destructor which calls clear(). Many other Gee collections do this, I think it would work here. The first step from here is for someone to check if this still occurs in git master.
I see where the problem is. Should be fixed in tomorrow release.
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.