diff --git a/gst/camerabin2/gstwrappercamerabinsrc.c b/gst/camerabin2/gstwrappercamerabinsrc.c index 731d91eb4a..0843d85785 100644 --- a/gst/camerabin2/gstwrappercamerabinsrc.c +++ b/gst/camerabin2/gstwrappercamerabinsrc.c @@ -223,7 +223,10 @@ static void gst_wrapper_camera_bin_src_set_output (GstWrapperCameraBinSrc * self, GstPad * old_pad, GstPad * output_pad) { - gst_pad_peer_query (self->src_pad, gst_query_new_drain ()); + GstQuery *drain = gst_query_new_drain (); + gst_pad_peer_query (self->src_pad, drain); + gst_query_unref (drain); + if (old_pad) gst_ghost_pad_set_target (GST_GHOST_PAD (old_pad), NULL); if (output_pad)