From da160ba18043b1df164830902e127f9c657f84de Mon Sep 17 00:00:00 2001 From: Heath Reinhard Date: Tue, 14 Apr 2026 18:05:12 -0700 Subject: [PATCH] Fix SIGABRT crash on macOS 26: dispatch toggleMenuIconDisabled to main queue The pollPB: method dispatches pasteboard reads to a background GCD queue. Inside that block, toggleMenuIconDisabled updates NSStatusItem images via setImage:/setTitle:. macOS 26 enforces stricter main-thread assertions for NSImageView operations in _NSAsynchronousPreparation, causing an abort trap. Wrap the background-thread call to toggleMenuIconDisabled in dispatch_async(dispatch_get_main_queue(), ...) so the UI update runs on the main thread. The first call (before the dispatch block) is already on the main thread and does not need wrapping. --- AppController.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/AppController.m b/AppController.m index 00848cb..71a2188 100755 --- a/AppController.m +++ b/AppController.m @@ -890,8 +890,11 @@ -(void)pollPB:(NSTimer *)timer NSString *contents = [jcPasteboard stringForType:type]; // Toggle back if dealing with the RDC issue. - if (largeCopyRisk) - [self toggleMenuIconDisabled]; + if (largeCopyRisk) { + dispatch_async(dispatch_get_main_queue(), ^{ + [self toggleMenuIconDisabled]; + }); + } if ( contents == nil || [flycutOperator shouldSkip:contents ofType:[jcPasteboard availableTypeFromArray:[NSArray arrayWithObject:NSStringPboardType]] fromAvailableTypes:[jcPasteboard types]] ) { DLog(@"Contents: Empty or skipped");