From: Bernhard Kölbl besentv@gmail.com
Signed-off-by: Bernhard Kölbl besentv@gmail.com --- dlls/windows.media.speech/async.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/dlls/windows.media.speech/async.c b/dlls/windows.media.speech/async.c index 5d20fe482f1..9560350d2e4 100644 --- a/dlls/windows.media.speech/async.c +++ b/dlls/windows.media.speech/async.c @@ -93,6 +93,20 @@ ULONG WINAPI async_void_Release( IAsyncAction *iface ) struct async_void *impl = impl_from_IAsyncAction(iface); ULONG ref = InterlockedDecrement(&impl->ref); TRACE("iface %p, ref %lu.\n", iface, ref); + + if (!ref) + { + IAsyncInfo_Close(&impl->IAsyncInfo_iface); + + if (impl->invoker) + IInspectable_Release(impl->invoker); + if (impl->handler && impl->handler != HANDLER_NOT_SET) + IAsyncActionCompletedHandler_Release(impl->handler); + + DeleteCriticalSection(&impl->cs); + free(impl); + } + return ref; }
@@ -127,7 +141,7 @@ HRESULT WINAPI async_void_put_Completed( IAsyncAction *iface, IAsyncActionComple else if (impl->handler != HANDLER_NOT_SET) hr = E_ILLEGAL_DELEGATE_ASSIGNMENT; /* - impl->handler can only be set once with async_operation_put_Completed, + impl->handler can only be set once with async_void_put_Completed, so by default we set a non HANDLER_NOT_SET value, in this case handler. */ else if ((impl->handler = handler))