summaryrefslogtreecommitdiffstats
path: root/src/gsttools/qgstreamervideowidget.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/gsttools/qgstreamervideowidget.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/gsttools/qgstreamervideowidget.cpp')
-rw-r--r--src/gsttools/qgstreamervideowidget.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gsttools/qgstreamervideowidget.cpp b/src/gsttools/qgstreamervideowidget.cpp
index 8297040c..7e11bfb2 100644
--- a/src/gsttools/qgstreamervideowidget.cpp
+++ b/src/gsttools/qgstreamervideowidget.cpp
@@ -137,8 +137,7 @@ void QGstreamerVideoWidgetControl::createVideoWidget()
if (!m_videoSink)
m_videoSink = gst_element_factory_make ("ximagesink", NULL);
- gst_object_ref (GST_OBJECT (m_videoSink)); //Take ownership
- gst_object_sink (GST_OBJECT (m_videoSink));
+ qt_gst_object_ref_sink(GST_OBJECT (m_videoSink)); //Take ownership
}
@@ -219,6 +218,7 @@ void QGstreamerVideoWidgetControl::updateNativeVideoSize()
//find video native size to update video widget size hint
GstPad *pad = gst_element_get_static_pad(m_videoSink,"sink");
GstCaps *caps = gst_pad_get_negotiated_caps(pad);
+ gst_object_unref(GST_OBJECT(pad));
if (caps) {
m_widget->setNativeSize(QGstUtils::capsCorrectedResolution(caps));