From 2cf4b6016e3b1dffb59ccfaf55199380ebf64b65 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 6 Jun 2020 16:03:13 -0500 Subject: [PATCH] strmbase: Clear the debug info before calling DeleteCriticalSection (Valgrind). Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- dlls/strmbase/filter.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dlls/strmbase/filter.c b/dlls/strmbase/filter.c index 2809832ee82..8b8182a13ab 100644 --- a/dlls/strmbase/filter.c +++ b/dlls/strmbase/filter.c @@ -532,11 +532,13 @@ void strmbase_filter_init(struct strmbase_filter *filter, IUnknown *outer, filter->ops = ops; } -void strmbase_filter_cleanup(struct strmbase_filter *This) +void strmbase_filter_cleanup(struct strmbase_filter *filter) { - if (This->clock) - IReferenceClock_Release(This->clock); + if (filter->clock) + IReferenceClock_Release(filter->clock); - This->IBaseFilter_iface.lpVtbl = NULL; - DeleteCriticalSection(&This->csFilter); + filter->IBaseFilter_iface.lpVtbl = NULL; + if (filter->csFilter.DebugInfo != (RTL_CRITICAL_SECTION_DEBUG *)-1) + filter->csFilter.DebugInfo->Spare[0] = 0; + DeleteCriticalSection(&filter->csFilter); }