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

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2022-05-04 19:32:14 +02:00 committed by Alexandre Julliard
parent 606dc246ff
commit d7701deddc
1 changed files with 2 additions and 1 deletions

View File

@ -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;