After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 625772 - Several GLib containers leak their contents upon destruction
Several GLib containers leak their contents upon destruction
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: general
0.9.x
Other All
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2010-08-01 17:31 UTC by carlo.teubner
Modified: 2014-06-27 19:14 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description carlo.teubner 2010-08-01 17:31:14 UTC
Currently, there is hardcoded support for List and SList only, which unrefs their contents when the list is destroyed (this is in CCodeBaseModule.get_destroy_func_expression ()). All remaining glib containers are missing this functionality:

Queue, AsyncQueue, HashTable, Tree, Sequence

In addition, bug 586577 applies to all these (memory is leaked when a removal function is called).

It might be worth inventing new attributes for dealing with them. Or we could just hardcode the logic, as done for List and SList.
Comment 1 Evan Nemerson 2010-08-04 07:33:15 UTC
GLib.Sequence, GLib.HashTable, GLib.Tree, and GLib.AsyncQueue shouldn't leak if you specify correct GLib.DestroyNotify functions. That only leaves GLib.Queue.
Comment 2 Evan Nemerson 2014-06-27 19:14:49 UTC
This was fixed a very long time ago.