diff --git a/gst/camerabin2/gstcamerabin2.c b/gst/camerabin2/gstcamerabin2.c index 22d37e9937..456a7ea261 100644 --- a/gst/camerabin2/gstcamerabin2.c +++ b/gst/camerabin2/gstcamerabin2.c @@ -278,6 +278,12 @@ gst_camera_bin_dispose (GObject * object) if (camerabin->imagebin_capsfilter) gst_object_unref (camerabin->imagebin_capsfilter); + if (camerabin->video_profile) + gst_encoding_profile_unref (camerabin->video_profile); + + if (camerabin->preview_caps) + gst_caps_replace (&camerabin->preview_caps, NULL); + G_OBJECT_CLASS (parent_class)->dispose (object); } diff --git a/gst/camerabin2/gstwrappercamerabinsrc.c b/gst/camerabin2/gstwrappercamerabinsrc.c index 66bad9af8e..864373bdc3 100644 --- a/gst/camerabin2/gstwrappercamerabinsrc.c +++ b/gst/camerabin2/gstwrappercamerabinsrc.c @@ -71,6 +71,9 @@ gst_wrapper_camera_bin_src_dispose (GObject * object) self->preview_pipeline = NULL; } + if (self->preview_caps) + gst_caps_replace (&self->preview_caps, NULL); + G_OBJECT_CLASS (parent_class)->dispose (object); }