Rémi Bernon : windows.gaming.input: AddRef on the returned async handler in get_Completed.

Alexandre Julliard julliard at winehq.org
Wed May 11 16:10:25 CDT 2022


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

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Wed May  4 19:32:14 2022 +0200

windows.gaming.input: AddRef on the returned async handler in get_Completed.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/windows.gaming.input/async.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dlls/windows.gaming.input/async.c b/dlls/windows.gaming.input/async.c
index 1426b3d8481..dfcb4144e74 100644
--- a/dlls/windows.gaming.input/async.c
+++ b/dlls/windows.gaming.input/async.c
@@ -146,7 +146,8 @@ static HRESULT WINAPI async_impl_get_Completed( IWineAsyncInfoImpl *iface, IWine
 
     EnterCriticalSection( &impl->cs );
     if (impl->status == Closed) hr = E_ILLEGAL_METHOD_CALL;
-    *handler = (impl->handler != HANDLER_NOT_SET) ? impl->handler : NULL;
+    if (impl->handler == NULL || impl->handler == HANDLER_NOT_SET) *handler = NULL;
+    else IWineAsyncOperationCompletedHandler_AddRef( (*handler = impl->handler) );
     LeaveCriticalSection( &impl->cs );
 
     return hr;




More information about the wine-cvs mailing list