diff options
author | Michael Goddard <michael.goddard@nokia.com> | 2012-03-05 19:01:02 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-05 10:15:56 +0100 |
commit | 34f2494df142b1c800bd06a3f25c46e0d6c7128c (patch) | |
tree | 8d4b40842da25eda04c482049c6113d47524f4af /src/gsttools/qvideosurfacegstsink.cpp | |
parent | 0ae0ad646869f3427775dc9203a0f6e0d037ae75 (diff) | |
download | qtmultimedia-34f2494df142b1c800bd06a3f25c46e0d6c7128c.tar.gz |
Fix a few memory leaks.
XV Buffer pool was leaking, the sink delegate was leaking, and the
sink wasn't chaining to parent class so GstObject stuff was leaking.
Change-Id: I5d6b6fe59dfb2b3c5367dfde8331e5943167b55d
Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
Diffstat (limited to 'src/gsttools/qvideosurfacegstsink.cpp')
-rw-r--r-- | src/gsttools/qvideosurfacegstsink.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gsttools/qvideosurfacegstsink.cpp b/src/gsttools/qvideosurfacegstsink.cpp index 89284628c..65aca1fb1 100644 --- a/src/gsttools/qvideosurfacegstsink.cpp +++ b/src/gsttools/qvideosurfacegstsink.cpp @@ -78,7 +78,7 @@ QVideoSurfaceGstDelegate::QVideoSurfaceGstDelegate( } } #ifdef HAVE_XVIDEO - m_pools.append(new QGstXvImageBufferPool()); + m_pools.append(new QGstXvImageBufferPool(this)); #endif updateSupportedFormats(); connect(m_surface, SIGNAL(supportedFormatsChanged()), this, SLOT(updateSupportedFormats())); @@ -87,7 +87,6 @@ QVideoSurfaceGstDelegate::QVideoSurfaceGstDelegate( QVideoSurfaceGstDelegate::~QVideoSurfaceGstDelegate() { - qDeleteAll(m_pools); setLastPrerolledBuffer(0); } @@ -502,6 +501,11 @@ void QVideoSurfaceGstSink::finalize(GObject *object) if (sink->lastRequestedCaps) gst_caps_unref(sink->lastRequestedCaps); sink->lastRequestedCaps = 0; + + delete sink->delegate; + + // Chain up + G_OBJECT_CLASS(sink_parent_class)->finalize(object); } GstStateChangeReturn QVideoSurfaceGstSink::change_state( |