diff --git a/channels/audin/client/mac/audin_mac.m b/channels/audin/client/mac/audin_mac.m index ecf3c8cc0..56b7ea96a 100644 --- a/channels/audin/client/mac/audin_mac.m +++ b/channels/audin/client/mac/audin_mac.m @@ -423,32 +423,34 @@ UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEn #if defined(MAC_OS_X_VERSION_10_14) if (@available(macOS 10.14, *)) { - AVAuthorizationStatus status = - [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeAudio]; - switch (status) - { - case AVAuthorizationStatusAuthorized: - mac->isAuthorized = TRUE; - break; - case AVAuthorizationStatusNotDetermined: - [AVCaptureDevice requestAccessForMediaType:AVMediaTypeAudio - completionHandler:^(BOOL granted) { - if (granted == YES) - { - mac->isAuthorized = TRUE; - } - else - WLog_WARN(TAG, "Microphone access denied by user"); - }]; - break; - case AVAuthorizationStatusRestricted: - WLog_WARN(TAG, "Microphone access restricted by policy"); - break; - case AVAuthorizationStatusDenied: - WLog_WARN(TAG, "Microphone access denied by policy"); - break; - default: - break; + @autoreleasepool { + AVAuthorizationStatus status = + [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeAudio]; + switch (status) + { + case AVAuthorizationStatusAuthorized: + mac->isAuthorized = TRUE; + break; + case AVAuthorizationStatusNotDetermined: + [AVCaptureDevice requestAccessForMediaType:AVMediaTypeAudio + completionHandler:^(BOOL granted) { + if (granted == YES) + { + mac->isAuthorized = TRUE; + } + else + WLog_WARN(TAG, "Microphone access denied by user"); + }]; + break; + case AVAuthorizationStatusRestricted: + WLog_WARN(TAG, "Microphone access restricted by policy"); + break; + case AVAuthorizationStatusDenied: + WLog_WARN(TAG, "Microphone access denied by policy"); + break; + default: + break; + } } } #endif