summaryrefslogtreecommitdiffstats
path: root/src/plugins/directshow/player/videosurfacefilter.cpp
diff options
context:
space:
mode:
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;
}