Zebediah Figura : quartz: Don't hold an extra reference in async_run_cb().

Alexandre Julliard julliard at winehq.org
Mon Nov 9 15:11:50 CST 2020


Module: wine
Branch: master
Commit: c44173dd496aa1d1c499e593b7902b2879730a34
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=c44173dd496aa1d1c499e593b7902b2879730a34

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Fri Nov  6 13:46:05 2020 -0600

quartz: Don't hold an extra reference in async_run_cb().

We don't actually need to, because we'll wait for the callback when stopping the graph.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49907
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/quartz/filtergraph.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c
index 0f22bb5888c..b7f15695a6d 100644
--- a/dlls/quartz/filtergraph.c
+++ b/dlls/quartz/filtergraph.c
@@ -1837,7 +1837,6 @@ static void CALLBACK async_run_cb(TP_CALLBACK_INSTANCE *instance, void *context,
     }
 
     LeaveCriticalSection(&graph->cs);
-    IUnknown_Release(graph->outer_unk);
 }
 
 static HRESULT WINAPI MediaControl_Run(IMediaControl *iface)
@@ -1897,7 +1896,6 @@ static HRESULT WINAPI MediaControl_Run(IMediaControl *iface)
             if (!graph->async_run_work)
                 graph->async_run_work = CreateThreadpoolWork(async_run_cb, graph, NULL);
             graph->needs_async_run = 1;
-            IUnknown_AddRef(graph->outer_unk);
             SubmitThreadpoolWork(graph->async_run_work);
         }
         else
@@ -5008,9 +5006,8 @@ static HRESULT WINAPI MediaFilter_Stop(IMediaFilter *iface)
 
     LeaveCriticalSection(&graph->cs);
 
-    /* Don't cancel the callback; it's holding a reference to the graph. */
     if (work)
-        WaitForThreadpoolWorkCallbacks(work, FALSE);
+        WaitForThreadpoolWorkCallbacks(work, TRUE);
 
     return hr;
 }
@@ -5059,9 +5056,8 @@ static HRESULT WINAPI MediaFilter_Pause(IMediaFilter *iface)
 
     LeaveCriticalSection(&graph->cs);
 
-    /* Don't cancel the callback; it's holding a reference to the graph. */
     if (work)
-        WaitForThreadpoolWorkCallbacks(work, FALSE);
+        WaitForThreadpoolWorkCallbacks(work, TRUE);
 
     return hr;
 }




More information about the wine-cvs mailing list