summaryrefslogtreecommitdiffstats
path: root/src/plugins/gstreamer/camerabin/camerabinrecorder.cpp
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@digia.com>2014-03-20 19:20:24 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-21 19:16:09 +0100
commit023c6ebcb9d990042f0e9a750fd6238d22001022 (patch)
treeb98e068ccbdae0a587179d657541cc857c9daf0c /src/plugins/gstreamer/camerabin/camerabinrecorder.cpp
parent60ba0afbde0ef53a12afb6c755ca6fd64aabf5da (diff)
GStreamer: fix memory leaks.
Many GStreamer objects were not properly managed or never released. Change-Id: I38b3854e8b9e2264b5b647f331d3bb16b886e2d6 Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
Diffstat (limited to 'src/plugins/gstreamer/camerabin/camerabinrecorder.cpp')
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinrecorder.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/plugins/gstreamer/camerabin/camerabinrecorder.cpp b/src/plugins/gstreamer/camerabin/camerabinrecorder.cpp
index 4ac0d942e..7cef82a69 100644
--- a/src/plugins/gstreamer/camerabin/camerabinrecorder.cpp
+++ b/src/plugins/gstreamer/camerabin/camerabinrecorder.cpp
@@ -191,10 +191,14 @@ GstEncodingContainerProfile *CameraBinRecorder::videoProfile()
GstEncodingProfile *audioProfile = m_session->audioEncodeControl()->createProfile();
GstEncodingProfile *videoProfile = m_session->videoEncodeControl()->createProfile();
- if (audioProfile)
- gst_encoding_container_profile_add_profile(containerProfile, audioProfile);
- if (videoProfile)
- gst_encoding_container_profile_add_profile(containerProfile, videoProfile);
+ if (audioProfile) {
+ if (!gst_encoding_container_profile_add_profile(containerProfile, audioProfile))
+ gst_encoding_profile_unref(audioProfile);
+ }
+ if (videoProfile) {
+ if (!gst_encoding_container_profile_add_profile(containerProfile, videoProfile))
+ gst_encoding_profile_unref(videoProfile);
+ }
}
return containerProfile;