[PATCH 2/6] windows.gaming.input: AddRef on the returned async handler in get_Completed.

Rémi Bernon wine at gitlab.winehq.org
Wed May 11 04:19:43 CDT 2022


From: Rémi Bernon <rbernon at codeweavers.com>

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 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;
-- 
GitLab


https://gitlab.winehq.org/wine/wine/-/merge_requests/53



More information about the wine-devel mailing list