Re: [Vala] Working with GLib.List and memory management



On Wed, 2009-07-01 at 01:24 +0400, Кутейников Дмитрий wrote:
It is some sort of a bug (or a feature). Vala inserts g_object_ref in
generated C-code after myList.prepend(myWidget); but it doesn't
decrease ref_counter after remove. The only way is to use
g_object_unref manually.

What you said is right. But that's not the full story. 

If we look at Adi's code more carefully, myList is not a
List<Gtk.Widget> it is a List. vala doesn't manage a List's member. 

The remaining ref adi observed, I bet, is the ref held by myWidget.
Gtk.Widget.destroy sends a destroy signal to all ref holders of mywidget
asking them to release the reference. The signal was ignored. This
reference is released when the variable myWidget leaves its domain.


Yu
_______________________________________________
Vala-list mailing list
Vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list




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