camerabinpreview: fix bus leak
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Fri, 15 Jul 2016 09:48:25 +0000 (11:48 +0200)
committerThiago Santos <thiagossantos@gmail.com>
Fri, 15 Jul 2016 16:41:48 +0000 (13:41 -0300)
We were never removing the watch introduced in
gst_camerabin_create_preview_pipeline() so its extra ref on the bus was
never released.

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

gst-libs/gst/basecamerabinsrc/gstcamerabinpreview.c

index cfdc074..48ec2fe 100644 (file)
@@ -235,7 +235,14 @@ gst_camerabin_destroy_preview_pipeline (GstCameraBinPreviewPipelineData *
   g_cond_clear (&preview->processing_cond);
 
   if (preview->pipeline) {
+    GstBus *bus;
+
     gst_element_set_state (preview->pipeline, GST_STATE_NULL);
+
+    bus = gst_pipeline_get_bus (GST_PIPELINE (preview->pipeline));
+    gst_bus_remove_watch (bus);
+    gst_object_unref (bus);
+
     gst_object_unref (preview->pipeline);
   }
   g_free (preview);