summaryrefslogtreecommitdiffstats
path: root/src/plugins/directshow/player/videosurfacefilter.cpp
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@theqtcompany.com>2015-10-31 21:47:27 +0100
committerYoann Lopes <yoann.lopes@theqtcompany.com>2015-11-06 16:47:08 +0000
commit12fba3bfb1e20397e6f703586a739f9cad41835c (patch)
treeff9a5d1dfb8691135c1ee6ef384b9c5fe6abc3eb /src/plugins/directshow/player/videosurfacefilter.cpp
parent1c7543a64072c07ca6d8741ae352e5f999f4c270 (diff)
DirectShow: fix custom renderer reference counting.
Change-Id: Iadefd4d72bdafb982a79b99ee5880dba32f3e920 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
Diffstat (limited to 'src/plugins/directshow/player/videosurfacefilter.cpp')
-rw-r--r--src/plugins/directshow/player/videosurfacefilter.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/directshow/player/videosurfacefilter.cpp b/src/plugins/directshow/player/videosurfacefilter.cpp
index 901d2e908..1fa7329cc 100644
--- a/src/plugins/directshow/player/videosurfacefilter.cpp
+++ b/src/plugins/directshow/player/videosurfacefilter.cpp
@@ -69,7 +69,7 @@ VideoSurfaceFilter::VideoSurfaceFilter(
VideoSurfaceFilter::~VideoSurfaceFilter()
{
- Q_ASSERT(m_ref == 1);
+ Q_ASSERT(m_ref == 0);
}
HRESULT VideoSurfaceFilter::QueryInterface(REFIID riid, void **ppvObject)
@@ -110,8 +110,8 @@ ULONG VideoSurfaceFilter::AddRef()
ULONG VideoSurfaceFilter::Release()
{
ULONG ref = InterlockedDecrement(&m_ref);
-
- Q_ASSERT(ref != 0);
+ if (ref == 0)
+ delete this;
return ref;
}