[PATCH] quartz: Wait for the PullPin thread to terminate.

Zebediah Figura z.figura12 at gmail.com
Thu Dec 21 11:49:02 CST 2017


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
Fixes an intermittent failure in the filtergraph tests where the source file
was not being freed before IFilterGraph2_Release() returned.

 dlls/quartz/pin.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/dlls/quartz/pin.c b/dlls/quartz/pin.c
index 355d87d..a17d256 100644
--- a/dlls/quartz/pin.c
+++ b/dlls/quartz/pin.c
@@ -540,13 +540,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);
-    }
-    LeaveCriticalSection(This->pin.pCritSec);
+    SetEvent(This->hEventStateChanged);
 
     IBaseFilter_Release(This->pin.pinInfo.pFilter);
 
@@ -706,6 +700,11 @@ static HRESULT PullPin_StopProcessing(PullPin * This)
     assert(WaitForSingleObject(This->thread_sleepy, 0) == WAIT_TIMEOUT);
     ResetEvent(This->hEventStateChanged);
     SetEvent(This->thread_sleepy);
+
+    WaitForSingleObject(This->hThread, INFINITE);
+    CloseHandle(This->hThread);
+    This->hThread = NULL;
+
     return S_OK;
 }
 
-- 
2.7.4




More information about the wine-devel mailing list