Fix SIGABRT crash on macOS 26: dispatch toggleMenuIconDisabled to main queue#323
Open
agentheath wants to merge 1 commit into
Open
Fix SIGABRT crash on macOS 26: dispatch toggleMenuIconDisabled to main queue#323agentheath wants to merge 1 commit into
agentheath wants to merge 1 commit into
Conversation
…n 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Wraps the background-thread call to
toggleMenuIconDisabledindispatch_async(dispatch_get_main_queue(), ...)inpollPB:.Why
pollPB:dispatches pasteboard reads to a background GCD queue to avoid blocking the main thread while waiting for large clipboard transfers (this is intentional — see the comment in the code). Inside that block,toggleMenuIconDisabledwas being called directly from the background thread to restore the menu icon after a Remote Desktop Connection transfer completes.toggleMenuIconDisabledmodifiesNSStatusItemviasetImage:andsetTitle:, which internally update anNSImageView. macOS 26 now enforces stricter main-thread assertions forNSImageViewoperations (via_NSAsynchronousPreparation), causing anabort trap/ SIGABRT.Fix
The first call to
toggleMenuIconDisabledat line 883 (before the dispatch block) is already on the main thread and does not need wrapping.Scope
Only
AppController.mis changed.BezelWindow.mwas audited —setSourceIcon:and related image methods are only reachable from main-thread code paths and do not need changes.