camerabinpreview: fix bus leak

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
This commit is contained in:
Guillaume Desmottes 2016-07-15 11:48:25 +02:00 committed by Thiago Santos
parent 6697feae5f
commit d29ec01b8a

View 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);