camerabin2: Some memleak fixes

This commit is contained in:
Thiago Santos 2011-03-11 10:32:35 -03:00
parent 5fd15521e2
commit 79bb475abe
2 changed files with 4 additions and 1 deletions

View file

@ -308,6 +308,8 @@ gst_camera_bin_dispose (GObject * object)
gst_object_unref (camerabin->audio_queue);
if (camerabin->audio_convert)
gst_object_unref (camerabin->audio_convert);
if (camerabin->audio_volume)
gst_object_unref (camerabin->audio_volume);
if (camerabin->viewfinderbin)
gst_object_unref (camerabin->viewfinderbin);
@ -1033,7 +1035,7 @@ gst_camera_bin_change_state (GstElement * element, GstStateChange trans)
case GST_STATE_CHANGE_PAUSED_TO_READY:
if (GST_STATE (camera->videosink) >= GST_STATE_PAUSED)
gst_element_set_state (camera->videosink, GST_STATE_READY);
if (camera->audio_src)
if (camera->audio_src && GST_STATE (camera->audio_src) >= GST_STATE_READY)
gst_element_set_state (camera->audio_src, GST_STATE_READY);
gst_tag_setter_reset_tags (GST_TAG_SETTER (camera));

View file

@ -58,6 +58,7 @@ gst_wrapper_camera_bin_src_dispose (GObject * object)
gst_object_unref (self->app_vid_src);
self->app_vid_src = NULL;
}
gst_caps_replace (&self->image_capture_caps, NULL);
G_OBJECT_CLASS (parent_class)->dispose (object);
}