[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [Vala] How to call a gst_object_ref in vala?
- From: Xavier Bestel <xavier bestel free fr>
- To: j bitron ch
- Cc: vala-list gnome org
- Subject: Re: [Vala] How to call a gst_object_ref in vala?
- Date: Mon, 28 Apr 2008 16:06:54 +0200
On Mon, 2008-04-28 at 16:03 +0200, Juerg Billeter wrote:
> On Mon, April 28, 2008 15:43, Jaap A. Haitsma wrote:
> > On Mon, Apr 28, 2008 at 1:44 PM, Juerg Billeter <j bitron ch> wrote:
> >> On Mon, April 28, 2008 12:55, Jaap A. Haitsma wrote:
> >> > I want to use a gst_bin_remove function [1], but I want the Element
> >> > that is removes not to be freed. For that I need to call
> >> > gst_object_ref before gst_bin_remove (See also [1]). How do I call
> >> > gst_object_ref in vala?
> >>
> >> This essentially means that you want to keep a reference to the child
> >> element. So just store it in a local variable or field and Vala will
> >> increment the reference count automatically. It will currently just
> >> call
> >> g_object_ref, not gst_object_ref, but that should work fine, we could
> >> change that to gst_object_ref for GstObjects.
> >>
> > Thanks, are you also planning on providing a function in vala to
> > increase ref count. Introducing another variable so you can increase
> > the refcount is a bit hacky if you ask me.
>
> Well, the point is that it only makes sense to increase the reference
> count if you have a reference to the object (else you leak memory). Why do
> you want to increase the reference count just without that, can you
> explain the situation?
Question #2: how do you decrease the reference count if you don't hold a
reference to the object anymore ?
Xav
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]