From 70e36975a9dc0c16d882d9eb008a1f51295d08dd Mon Sep 17 00:00:00 2001 From: Nathan Moinvaziri Date: Wed, 25 Oct 2023 17:43:55 -0700 Subject: [PATCH] Fix crash bug when releasing IAsyncOperation_ProxyConfiguration on WinRT --- resolver_winrt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/resolver_winrt.c b/resolver_winrt.c index a958e97..3ecb51e 100644 --- a/resolver_winrt.c +++ b/resolver_winrt.c @@ -378,10 +378,11 @@ bool proxy_resolver_winrt_delete(void **ctx) { if (!proxy_resolver) return false; proxy_resolver_winrt_cancel(ctx); - if (proxy_resolver->complete_handler->async) - WinRT_IAsyncOperation_ProxyConfiguration_Release(proxy_resolver->complete_handler->async); - if (proxy_resolver->complete_handler) + if (proxy_resolver->complete_handler) { + if (proxy_resolver->complete_handler->async) + WinRT_IAsyncOperation_ProxyConfiguration_Release(proxy_resolver->complete_handler->async); free(proxy_resolver->complete_handler); + } event_delete(&proxy_resolver->complete); free(proxy_resolver->list); free(proxy_resolver);