[Bug 693800] Problem with ref counter in adding/removing element to/from bin more than once

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Thu Feb 14 09:59:16 PST 2013


https://bugzilla.gnome.org/show_bug.cgi?id=693800
  GStreamer | gstreamer (core) | 1.x

--- Comment #2 from Alexander Schrab <alexas at axis.com> 2013-02-14 17:59:08 UTC ---
Ok, after reading up on the initially unknown and looking around I realize this
is as designed. So in my case the correct form would be:

  GstElement *element = gst_ref_sink(gst_element_factory_make("fakesink",
NULL));
  GstBin *bin = (GstBin*)gst_bin_new("test");
  g_print("refcount: %u\n", GST_OBJECT_REFCOUNT(element));
  gst_bin_add(bin, element);
  g_print("refcount: %u\n", GST_OBJECT_REFCOUNT(element));
  gst_bin_remove(bin, element);
  g_print("refcount: %u\n", GST_OBJECT_REFCOUNT(element));
  gst_bin_add(bin, element);
  g_print("refcount: %u\n", GST_OBJECT_REFCOUNT(element));
  gst_bin_remove(bin, element);

-- 
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