diff options
author | Sebastian Rasmussen <sebras@hotmail.com> | 2014-08-09 11:36:38 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2014-08-11 08:50:24 +0200 |
commit | 4e53109aa4124da4d98364208de7f545269b300b (patch) | |
tree | 5292c74c8f95fde2e35f71c2aab54cc43cc2a364 /gst | |
parent | 044a53366f4c9d11738b4f3eac0e0664fdd6d8b3 (diff) |
wrappercamerabinsrc: Unref elements after usage
gst_bin_get_by_name() and gst_bin_get_by_interface() both return
references to elements that need to be unreferenced after usage.
https://bugzilla.gnome.org/show_bug.cgi?id=734524
Diffstat (limited to 'gst')
-rw-r--r-- | gst/camerabin2/gstwrappercamerabinsrc.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gst/camerabin2/gstwrappercamerabinsrc.c b/gst/camerabin2/gstwrappercamerabinsrc.c index 32fb38ee0..3f3a3b9b4 100644 --- a/gst/camerabin2/gstwrappercamerabinsrc.c +++ b/gst/camerabin2/gstwrappercamerabinsrc.c @@ -484,8 +484,10 @@ check_and_replace_src (GstWrapperCameraBinSrc * self) if (videoconvert) { if (!gst_element_link_pads (self->src_vid_src, "src", videoconvert, "sink")) { + gst_object_unref (videoconvert); return FALSE; } + gst_object_unref (videoconvert); } } @@ -675,8 +677,13 @@ gst_wrapper_camera_bin_src_construct_pipeline (GstBaseCameraSrc * bcamsrc) if (gst_pad_is_linked (gst_element_get_static_pad (src_csp, "src"))) gst_element_unlink (src_csp, capsfilter); if (!gst_element_link_many (src_csp, self->video_filter, filter_csp, - capsfilter, NULL)) + capsfilter, NULL)) { + gst_object_unref (src_csp); + gst_object_unref (capsfilter); goto done; + } + gst_object_unref (src_csp); + gst_object_unref (capsfilter); } } ret = TRUE; @@ -870,6 +877,7 @@ start_image_capture (GstWrapperCameraBinSrc * self) ret = gst_photography_prepare_for_capture (photography, (GstPhotographyCapturePrepared) img_capture_prepared, self->image_capture_caps, self); + gst_object_unref (photography); } else { g_mutex_unlock (&bcamsrc->capturing_mutex); gst_wrapper_camera_bin_reset_video_src_caps (self, @@ -909,6 +917,7 @@ gst_wrapper_camera_bin_src_set_mode (GstBaseCameraSrc * bcamsrc, "capture-mode")) { g_object_set (G_OBJECT (photography), "capture-mode", mode, NULL); } + gst_object_unref (photography); } else { GstCaps *anycaps = gst_caps_new_any (); gst_wrapper_camera_bin_reset_video_src_caps (self, anycaps); |