This helps having "make check" passing with the leaks tracer enabled.
https://bugzilla.gnome.org/show_bug.cgi?id=766008
*caps = gst_caps_from_string (string);
+ /* Caps generated from static caps are usually leaked */
+ GST_MINI_OBJECT_FLAG_SET (*caps, GST_MINI_OBJECT_FLAG_MAY_BE_LEAKED);
+
/* convert to string */
if (G_UNLIKELY (*caps == NULL))
g_critical ("Could not convert static caps \"%s\"", string);
* an device provider at the same moment
*/
oclass = GST_DEVICE_PROVIDER_GET_CLASS (device_provider);
- if (!g_atomic_pointer_compare_and_exchange (&oclass->factory, NULL, factory))
+ if (!g_atomic_pointer_compare_and_exchange (&oclass->factory, NULL, factory)) {
gst_object_unref (factory);
+ } else {
+ /* This ref will never be dropped as the class is never destroyed */
+ GST_OBJECT_FLAG_SET (factory, GST_OBJECT_FLAG_MAY_BE_LEAKED);
+ }
gst_object_ref_sink (device_provider);
if (!g_atomic_pointer_compare_and_exchange (&oclass->elementfactory, NULL,
factory))
gst_object_unref (factory);
+ else
+ /* This ref will never be dropped as the class is never destroyed */
+ GST_OBJECT_FLAG_SET (factory, GST_OBJECT_FLAG_MAY_BE_LEAKED);
GST_DEBUG ("created element \"%s\"", GST_OBJECT_NAME (factory));
static void
gst_pad_template_init (GstPadTemplate * templ)
{
+ /* GstPadTemplate objects are usually leaked */
+ GST_OBJECT_FLAG_SET (templ, GST_OBJECT_FLAG_MAY_BE_LEAKED);
}
static void
break;
case PROP_CAPS:
GST_PAD_TEMPLATE_CAPS (object) = g_value_dup_boxed (value);
+ /* GstPadTemplate are usually leaked so are their caps */
+ GST_MINI_OBJECT_FLAG_SET (GST_PAD_TEMPLATE_CAPS (object),
+ GST_MINI_OBJECT_FLAG_MAY_BE_LEAKED);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
gst_object_unref (klass->pool);
}
klass->pool = gst_task_pool_new ();
+ /* Classes are never destroyed so this ref will never be dropped */
+ GST_OBJECT_FLAG_SET (klass->pool, GST_OBJECT_FLAG_MAY_BE_LEAKED);
gst_task_pool_prepare (klass->pool, NULL);
g_mutex_unlock (&pool_lock);
}
self->priv->address, "port", self->priv->port, "is-ntp",
self->priv->is_ntp, NULL);
clocks = g_list_prepend (clocks, cache);
+
+ /* Not actually leaked but is cached for a while before being disposed,
+ * see gst_net_client_clock_finalize, so pretend it is to not confuse
+ * tests. */
+ GST_OBJECT_FLAG_SET (cache->clock, GST_OBJECT_FLAG_MAY_BE_LEAKED);
}
cache->clocks = g_list_prepend (cache->clocks, self);