From 6e8db5a6714ca6883a6c02fbabdf287b3934f33c Mon Sep 17 00:00:00 2001 From: Dominik Holland Date: Thu, 18 Apr 2013 17:16:38 +0200 Subject: [PATCH] Reset VideoSurface pointer when deleted Change-Id: Iec74c8a8b914d2c2765e0e1f319d89f3daedfe3f Reviewed-by: J-P Nurmi --- src/gsttools/qgstreamervideorenderer.cpp | 4 ++-- src/multimedia/gsttools_headers/qgstreamervideorenderer_p.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gsttools/qgstreamervideorenderer.cpp b/src/gsttools/qgstreamervideorenderer.cpp index 4bc92a1..5b0b0d7 100644 --- a/src/gsttools/qgstreamervideorenderer.cpp +++ b/src/gsttools/qgstreamervideorenderer.cpp @@ -90,7 +90,7 @@ void QGstreamerVideoRenderer::setSurface(QAbstractVideoSurface *surface) m_videoSink = 0; if (m_surface) { - disconnect(m_surface, SIGNAL(supportedFormatsChanged()), + disconnect(m_surface.data(), SIGNAL(supportedFormatsChanged()), this, SLOT(handleFormatChange())); } @@ -99,7 +99,7 @@ void QGstreamerVideoRenderer::setSurface(QAbstractVideoSurface *surface) m_surface = surface; if (m_surface) { - connect(m_surface, SIGNAL(supportedFormatsChanged()), + connect(m_surface.data(), SIGNAL(supportedFormatsChanged()), this, SLOT(handleFormatChange())); } diff --git a/src/multimedia/gsttools_headers/qgstreamervideorenderer_p.h b/src/multimedia/gsttools_headers/qgstreamervideorenderer_p.h index b7121e0..42ce913 100644 --- a/src/multimedia/gsttools_headers/qgstreamervideorenderer_p.h +++ b/src/multimedia/gsttools_headers/qgstreamervideorenderer_p.h @@ -44,6 +44,7 @@ #include #include +#include #include "qgstreamervideorendererinterface_p.h" @@ -74,7 +75,7 @@ private slots: private: QVideoSurfaceGstSink *m_videoSink; - QAbstractVideoSurface *m_surface; + QPointer m_surface; }; QT_END_NAMESPACE -- 2.7.4