You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: use Task { @mainactor in } in all view button actions to prevent SIGSEGV crash (#121)
Bare Task { } closures inside SwiftUI Button actions caused an
EXC_BAD_ACCESS (SIGSEGV) crash on macOS 26 when the Swift concurrency
runtime called MainActor.assumeIsolated() on a stale executor reference.
This was reliably triggered by:
1. Replug a microphone while recording (causes AVAudioEngineConfigurationChange)
2. App auto-recovers via onAudioDeviceChanged → sets appStatus = .idle
3. User clicks Stop Recording button on the now-stale SwiftUI view node
4. _ButtonGesture dispatches via MainActor.assumeIsolated() → reads freed memory → crash
Fix: annotate every Task spawned from a Button/onAppear in views with
@mainactor, which removes the implicit assumeIsolated() call and binds
the task directly to the main actor instead.
Also reset silenceCallbackFired and maxDurationCallbackFired in
AudioEngine.handleAudioConfigurationChange so stale callback state
cannot fire spurious stop/timeout events after a device reconnect.
0 commit comments