[Vala] Working with GLib.List and memory management



Hi,

I have read about using GLib.List here:

http://live.gnome.org/Vala/ListSample

The example works, but I have a more complex usage scenario where I fail
to understand how GLib.List works.

use GLib;
List myList = new List<Gtk.Widget>();
Gtk.Widget myWidget = new Gtk.Widget();
myList.prepend(myWidget);
myList.remove_all(myWidget);
myWidget.destroy();

At the end "myWidget" ref_counter in not 0  and the object is not
finalized.

If I'm using Gee.ArrayList everthing is OK.

How should I work with GLib.List and make sure I'm not wasting memory.

Many thanks!
-- 
Adi Roiban




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]