[Bug 793294] New: Add a gst_clear_object (similar to g_clear_object)

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Thu Feb 8 09:47:12 UTC 2018


https://bugzilla.gnome.org/show_bug.cgi?id=793294

            Bug ID: 793294
           Summary: Add a gst_clear_object (similar to g_clear_object)
    Classification: Platform
           Product: GStreamer
           Version: unspecified
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: gstreamer (core)
          Assignee: gstreamer-bugs at lists.freedesktop.org
          Reporter: nielsdegraef at gmail.com
        QA Contact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---

Right now, to unref a GstObject, you have multiple options:

(1) Check for !NULL and use `gst_object_unref`
(2) Use `g_object_unref` -- but this doesn't do any kind refcount logging
(3) Use `g_clear_object` -- but has the same problem as (2)
(4) Use g_clear_pointer with gst_object_unref()

In this bug, I propose a new `gst_clear_object ()` macro, which is analoguous
to `g_clear_object` and basically expands to `g_clear_pointer (obj,
gst_object_unref)`. That way, we have the advantages of (3) and (4) combined
into one.

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