[gst-devel] explicit g_object_dispose on anything?

Mathrick mnews2 at wp.pl
Thu Feb 5 15:24:16 CET 2004


W liście z czw, 05-02-2004, godz. 18:48, in7y118 at public.uni-hamburg.de
pisze: 
> Quoting Andy Wingo <wingo at pobox.com>:
> 
> > Hey folks,
> > 
> > I was going through gstpad.c and gstelement.c doing some cleanups, and I
> > saw some assertions in the real pad dispose code. The assertion (that a
> > pad being disposed has no peer) would hold for a dispose run by a final
> > unref, but not for an explicit call to g_object_dispose (pad).
> > 
> > My question is, is it legal to call g_object_dispose on anything you
> > please? http://www.gnome.org/~mathieu/gobject/ch04s02.html seems to
> > suggest that that is a possibility.
> > 
> Maybe we need to do s/dispose/finalize/ everywhere?

No. You cannot safely replace dispose with finalize. In fact, you
should't even consider them in terms of alternatives, they're
complementary and supposed to be (eventually) called in order.

> I'm not even sure what the difference between dispose and finalize is.

It's kinda substantial, although not obvious and for many uses it may go
unnoticed.

> Anyone knows?

Yep. http://www.le-hacker.org/papers/gobject/ch04s02.html ;)

-- 
"Tautologizm to coś tautologicznego"
   Maciej Katafiasz <mnews2 at wp.pl>
       http://mathrick.blog.pl





More information about the gstreamer-devel mailing list