mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-18 05:16:05 +00:00
GST_REFCOUNTING: Add logging of pointer address for dispose, finalize, etc messages
Updated the GST_REFCOUNTING logging so that it includes the pointer address of the object that is being disposed or finalized. With this change is is then possible to match up GST_REFCOUNTING log messages for object allocation/disposal/finalization. This can help with diagnosing "memory leaks" in applications that have not correctly disposed of all the GStreamer objects it creates. https://bugzilla.gnome.org/show_bug.cgi?id=749427
This commit is contained in:
parent
1bb699446a
commit
b8f2929dac
6 changed files with 12 additions and 10 deletions
|
@ -514,7 +514,7 @@ gst_bin_dispose (GObject * object)
|
|||
GstClock **provided_clock_p = &bin->provided_clock;
|
||||
GstElement **clock_provider_p = &bin->clock_provider;
|
||||
|
||||
GST_CAT_DEBUG_OBJECT (GST_CAT_REFCOUNTING, object, "dispose");
|
||||
GST_CAT_DEBUG_OBJECT (GST_CAT_REFCOUNTING, object, "%p dispose", object);
|
||||
|
||||
GST_OBJECT_LOCK (object);
|
||||
gst_object_replace ((GstObject **) child_bus_p, NULL);
|
||||
|
|
|
@ -187,7 +187,7 @@ gst_buffer_pool_finalize (GObject * object)
|
|||
pool = GST_BUFFER_POOL_CAST (object);
|
||||
priv = pool->priv;
|
||||
|
||||
GST_DEBUG_OBJECT (pool, "finalize");
|
||||
GST_DEBUG_OBJECT (pool, "%p finalize", pool);
|
||||
|
||||
gst_buffer_pool_set_active (pool, FALSE);
|
||||
gst_atomic_queue_unref (priv->queue);
|
||||
|
|
|
@ -2944,7 +2944,7 @@ gst_element_dispose (GObject * object)
|
|||
|
||||
oclass = GST_ELEMENT_GET_CLASS (element);
|
||||
|
||||
GST_CAT_INFO_OBJECT (GST_CAT_REFCOUNTING, element, "dispose");
|
||||
GST_CAT_INFO_OBJECT (GST_CAT_REFCOUNTING, element, "%p dispose", element);
|
||||
|
||||
if (GST_STATE (element) != GST_STATE_NULL)
|
||||
goto not_null;
|
||||
|
@ -2989,7 +2989,8 @@ gst_element_dispose (GObject * object)
|
|||
g_list_free_full (element->contexts, (GDestroyNotify) gst_context_unref);
|
||||
GST_OBJECT_UNLOCK (element);
|
||||
|
||||
GST_CAT_INFO_OBJECT (GST_CAT_REFCOUNTING, element, "parent class dispose");
|
||||
GST_CAT_INFO_OBJECT (GST_CAT_REFCOUNTING, element, "%p parent class dispose",
|
||||
element);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->dispose (object);
|
||||
|
||||
|
@ -3020,12 +3021,13 @@ gst_element_finalize (GObject * object)
|
|||
{
|
||||
GstElement *element = GST_ELEMENT_CAST (object);
|
||||
|
||||
GST_CAT_INFO_OBJECT (GST_CAT_REFCOUNTING, element, "finalize");
|
||||
GST_CAT_INFO_OBJECT (GST_CAT_REFCOUNTING, element, "%p finalize", element);
|
||||
|
||||
g_cond_clear (&element->state_cond);
|
||||
g_rec_mutex_clear (&element->state_lock);
|
||||
|
||||
GST_CAT_INFO_OBJECT (GST_CAT_REFCOUNTING, element, "finalize parent");
|
||||
GST_CAT_INFO_OBJECT (GST_CAT_REFCOUNTING, element, "%p finalize parent",
|
||||
element);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
|
|
@ -366,7 +366,7 @@ gst_object_dispose (GObject * object)
|
|||
GstObject *self = (GstObject *) object;
|
||||
GstObject *parent;
|
||||
|
||||
GST_CAT_TRACE_OBJECT (GST_CAT_REFCOUNTING, object, "dispose");
|
||||
GST_CAT_TRACE_OBJECT (GST_CAT_REFCOUNTING, object, "%p dispose", object);
|
||||
|
||||
GST_OBJECT_LOCK (object);
|
||||
if ((parent = GST_OBJECT_PARENT (object)))
|
||||
|
@ -408,7 +408,7 @@ gst_object_finalize (GObject * object)
|
|||
{
|
||||
GstObject *gstobject = GST_OBJECT_CAST (object);
|
||||
|
||||
GST_CAT_TRACE_OBJECT (GST_CAT_REFCOUNTING, object, "finalize");
|
||||
GST_CAT_TRACE_OBJECT (GST_CAT_REFCOUNTING, object, "%p finalize", object);
|
||||
|
||||
g_signal_handlers_destroy (object);
|
||||
|
||||
|
|
|
@ -699,7 +699,7 @@ gst_pad_dispose (GObject * object)
|
|||
GstPad *pad = GST_PAD_CAST (object);
|
||||
GstPad *peer;
|
||||
|
||||
GST_CAT_DEBUG_OBJECT (GST_CAT_REFCOUNTING, pad, "dispose");
|
||||
GST_CAT_DEBUG_OBJECT (GST_CAT_REFCOUNTING, pad, "%p dispose", pad);
|
||||
|
||||
/* unlink the peer pad */
|
||||
if ((peer = gst_pad_get_peer (pad))) {
|
||||
|
|
|
@ -243,7 +243,7 @@ gst_pipeline_dispose (GObject * object)
|
|||
GstPipeline *pipeline = GST_PIPELINE (object);
|
||||
GstClock **clock_p = &pipeline->fixed_clock;
|
||||
|
||||
GST_CAT_DEBUG_OBJECT (GST_CAT_REFCOUNTING, pipeline, "dispose");
|
||||
GST_CAT_DEBUG_OBJECT (GST_CAT_REFCOUNTING, pipeline, "%p dispose", pipeline);
|
||||
|
||||
/* clear and unref any fixed clock */
|
||||
gst_object_replace ((GstObject **) clock_p, NULL);
|
||||
|
|
Loading…
Reference in a new issue