From 5aca15e0dfdbc7b07e0c72b4df384c682d39f0ea Mon Sep 17 00:00:00 2001 From: artginzburg Date: Thu, 18 Nov 2021 15:22:30 +0300 Subject: [PATCH] Support for Apple Silicon (#23) --- MiddleClick.xcodeproj/project.pbxproj | 4 ++-- MiddleClick/Controller.m | 23 ++++++++++++----------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/MiddleClick.xcodeproj/project.pbxproj b/MiddleClick.xcodeproj/project.pbxproj index dd9f1d9..2fb01ff 100644 --- a/MiddleClick.xcodeproj/project.pbxproj +++ b/MiddleClick.xcodeproj/project.pbxproj @@ -218,7 +218,7 @@ CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 10102021; + CURRENT_PROJECT_VERSION = 18112021; DEVELOPMENT_TEAM = R2294BC6J8; ENABLE_HARDENED_RUNTIME = YES; FRAMEWORK_SEARCH_PATHS = ( @@ -250,7 +250,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 10102021; + CURRENT_PROJECT_VERSION = 18112021; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = R2294BC6J8; ENABLE_HARDENED_RUNTIME = YES; diff --git a/MiddleClick/Controller.m b/MiddleClick/Controller.m index 157902e..571447a 100644 --- a/MiddleClick/Controller.m +++ b/MiddleClick/Controller.m @@ -102,13 +102,14 @@ - (void)start @"attached devices", err); IONotificationPortDestroy(port); - } else { - /// Iterate through all the existing entries to arm the notification. - io_object_t item; - while ((item = IOIteratorNext(handle))) { - CFRelease(item); - } } +// else { + /// Iterate through all the existing entries to arm the notification. Removed due to: https://stackoverflow.com/questions/1209130/iphone-sdk-exc-bad-access-with-cfrelease-for-abaddressbookref +// io_object_t item; +// while ((item = IOIteratorNext(handle))) { +// CFRelease(item); +// } +// } // when displays are reconfigured restart of the app is needed, so add a calback to the // reconifguration of Core Graphics @@ -302,11 +303,11 @@ static void restartApp() void multitouchDeviceAddedCallback(void* _controller, io_iterator_t iterator) { - /// Loop through all the returned items. - io_object_t item; - while ((item = IOIteratorNext(iterator))) { - CFRelease(item); - } + /// Loop through all the returned items. Removed due to: https://stackoverflow.com/questions/1209130/iphone-sdk-exc-bad-access-with-cfrelease-for-abaddressbookref +// io_object_t item; +// while ((item = IOIteratorNext(iterator))) { +// CFRelease(item); +// } NSLog(@"Multitouch device added, restarting..."); Controller* controller = (Controller*)_controller;