Re: [Vala] Working with GLib.List and memory management
- From: Yu Feng <rainwoodman gmail com>
- To: Кутейников Дмитрий <kuteynikov gmail com>
- Cc: vala-list gnome org
- Subject: Re: [Vala] Working with GLib.List and memory management
- Date: Wed, 01 Jul 2009 15:50:16 +0800
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]