From 55b37182056ed5a00b0a7796109d10265cc36492 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Fri, 19 Jan 2018 17:54:39 -0600 Subject: [PATCH] quartz: Wait for the PullPin thread to terminate. Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- dlls/quartz/pin.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/quartz/pin.c b/dlls/quartz/pin.c index 355d87d9d5a..5197d5ceb9a 100644 --- a/dlls/quartz/pin.c +++ b/dlls/quartz/pin.c @@ -541,11 +541,7 @@ static void PullPin_Thread_Stop(PullPin *This) TRACE("(%p)->()\n", This); EnterCriticalSection(This->pin.pCritSec); - { - CloseHandle(This->hThread); - This->hThread = NULL; - SetEvent(This->hEventStateChanged); - } + SetEvent(This->hEventStateChanged); LeaveCriticalSection(This->pin.pCritSec); IBaseFilter_Release(This->pin.pinInfo.pFilter); @@ -831,6 +827,10 @@ HRESULT WINAPI PullPin_Disconnect(IPin *iface) } LeaveCriticalSection(This->pin.pCritSec); + WaitForSingleObject(This->hThread, INFINITE); + CloseHandle(This->hThread); + This->hThread = NULL; + return hr; }