From 300b542dc59e26a5031e8560bff9d44e25bf30b7 Mon Sep 17 00:00:00 2001 From: Oliver Collyer Date: Thu, 9 Jan 2020 12:53:24 +0000 Subject: [PATCH] Fixed iOS crash in route change handler under ARC --- miniaudio.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/miniaudio.h b/miniaudio.h index 080c1777..b611cbcf 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -20038,7 +20038,7 @@ void ma_device_uninit__coreaudio(ma_device* pDevice) #endif #if defined(MA_APPLE_MOBILE) if (pDevice->coreaudio.pRouteChangeHandler != NULL) { - ma_router_change_handler* pRouteChangeHandler = (__bridge ma_router_change_handler*)pDevice->coreaudio.pRouteChangeHandler; + ma_router_change_handler* pRouteChangeHandler = (__bridge_transfer ma_router_change_handler*)pDevice->coreaudio.pRouteChangeHandler; [pRouteChangeHandler remove_handler]; } #endif @@ -20695,7 +20695,7 @@ ma_result ma_device_init__coreaudio(ma_context* pContext, const ma_device_config differently on non-Desktop Apple platforms. */ #if defined(MA_APPLE_MOBILE) - pDevice->coreaudio.pRouteChangeHandler = (__bridge void*)[[ma_router_change_handler alloc] init:pDevice]; + pDevice->coreaudio.pRouteChangeHandler = (__bridge_retained void*)[[ma_router_change_handler alloc] init:pDevice]; #endif return MA_SUCCESS;