summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-11-08 15:04:46 +0100
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-11-08 15:04:46 +0100
commitf771b34d7e288c172f773d440d9ee46e85548f2f (patch)
treebabae35a351ee0fae030e08c106e4924c98718da
parentc609b0e6f8ab46e3e5282dd32fa124cb9e3fe110 (diff)
parentb42659eb8baa384e329e6af6afea89bb4005fb46 (diff)
Merge 5.9 into 5.9.3v5.9.3
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinsession.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/plugins/gstreamer/camerabin/camerabinsession.cpp b/src/plugins/gstreamer/camerabin/camerabinsession.cpp
index ab0bea24..4941c6ef 100644
--- a/src/plugins/gstreamer/camerabin/camerabinsession.cpp
+++ b/src/plugins/gstreamer/camerabin/camerabinsession.cpp
@@ -212,6 +212,12 @@ CameraBinSession::~CameraBinSession()
if (m_sourceFactory)
gst_object_unref(GST_OBJECT(m_sourceFactory));
+
+ if (m_cameraSrc)
+ gst_object_unref(GST_OBJECT(m_cameraSrc));
+
+ if (m_videoSrc)
+ gst_object_unref(GST_OBJECT(m_videoSrc));
}
#if QT_CONFIG(gstreamer_photography)
@@ -538,11 +544,12 @@ GstElement *CameraBinSession::buildCameraSource()
}
}
- if (m_cameraSrc != camSrc)
+ if (m_cameraSrc != camSrc) {
g_object_set(G_OBJECT(m_camerabin), CAMERA_SOURCE_PROPERTY, m_cameraSrc, NULL);
-
- if (camSrc)
- gst_object_unref(GST_OBJECT(camSrc));
+ // Unref only if camSrc is not m_cameraSrc to prevent double unrefing.
+ if (camSrc)
+ gst_object_unref(GST_OBJECT(camSrc));
+ }
return m_cameraSrc;
}