[Bug 650576] dynamic pipeline ref issue

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Fri May 20 06:57:39 PDT 2011


https://bugzilla.gnome.org/show_bug.cgi?id=650576
  GStreamer | gstreamer (core) | 0.10.35

--- Comment #11 from Wim Taymans <wim.taymans at gmail.com> 2011-05-20 13:57:33 UTC ---
> we know how reference counting is working:-) we just don't know how and when
> reference counting works in gstreamer?
> eg in the above case why gst_element_set_state rise it from 1 to 5? who hold in
> this case those 4 reference and who can release it? what is the proper way?

You can use the debug log to find out who keeps a ref to those elements, as Tim
said, it is likely the messages (which are unreffed when popped from the bus).
In GStreamer many objects keep refs around to other objects and threads
increase and decrease refcounts all the time to keep objects alive in unlocked
areas.

You should use a tool like valgrind to figure out what objects are leaked and
then figure out where to place _unrefs(). There is nothing else that can be
done.

For applications the rules are very simple, look at the docs of all methods
that you use and respect the refcounting rules there. The generic rules are:
getters returning objects return an additional ref, methods taking an object
take extra refs to the object when they need to. Exceptions are for the methods
that take ownership of objects (and don't increase the refcount, you lose the
ref you are holding).

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list