opusenc, subtitleoverlay: use MAY_BE_LEAKED flag
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 2 Jun 2016 11:07:01 +0000 (13:07 +0200)
committerTim-Philipp Müller <tim@centricular.com>
Thu, 2 Jun 2016 12:11:11 +0000 (13:11 +0100)
Flag caps that are cached locally and will never be freed.

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

ext/opus/gstopusenc.c
gst/playback/gstsubtitleoverlay.c

index ed84058..e06b75c 100644 (file)
@@ -812,6 +812,9 @@ gst_opus_enc_get_sink_template_caps (void)
 
     caps = gst_caps_new_empty ();
 
+    /* The caps is cached */
+    GST_MINI_OBJECT_FLAG_SET (caps, GST_MINI_OBJECT_FLAG_MAY_BE_LEAKED);
+
     /* Generate our two template structures */
     g_value_init (&rate_array, GST_TYPE_LIST);
     g_value_init (&v, G_TYPE_INT);
index d3e0287..65159e8 100644 (file)
@@ -430,6 +430,10 @@ gst_subtitle_overlay_create_factory_caps (void)
       gst_caps_unref (_factory_caps);
     _factory_caps = gst_caps_new_empty ();
 
+    /* The caps is cached */
+    GST_MINI_OBJECT_FLAG_SET (_factory_caps,
+        GST_MINI_OBJECT_FLAG_MAY_BE_LEAKED);
+
     factories = gst_registry_feature_filter (registry,
         (GstPluginFeatureFilter) _factory_filter, FALSE, &_factory_caps);
     GST_DEBUG ("Created factory caps: %" GST_PTR_FORMAT, _factory_caps);