Skip to content

修复 macOS 26.5 上点击菜单栏闪退的 EXC_BREAKPOINT 崩溃#956

Open
wyr1028 wants to merge 1 commit into
jordanbaird:mainfrom
wyr1028:fix/crash-on-macos-26
Open

修复 macOS 26.5 上点击菜单栏闪退的 EXC_BREAKPOINT 崩溃#956
wyr1028 wants to merge 1 commit into
jordanbaird:mainfrom
wyr1028:fix/crash-on-macos-26

Conversation

@wyr1028

@wyr1028 wyr1028 commented Jun 23, 2026

Copy link
Copy Markdown

修复在 macOS 26.5+ 上开启 Ice Bar 后点击菜单栏图标导致闪退的问题。

修改内容:

  • NSScreen.displayID: 将强制转型 (as! CGDirectDisplayID) 改为安全可选转型
    (as? NSNumber)?.uint32Value,防止 NSScreenNumber 值类型随系统版本变化时崩溃
  • NSBezierPath: 将强制转型改为安全可选绑定
  • IceBar: 增加 windowID != 0 有效性检查,过滤无效窗口

修复 #947

emindeniz99 pushed a commit to emindeniz99/Ice that referenced this pull request Jun 24, 2026
The unchecked `as! NSBezierPath` in the shadow-drawing helper has been
correlated with EXC_BREAKPOINT crashes on the main thread on macOS 26.5
(see jordanbaird#956). The runtime invariant 'NSBezierPath.copy()
returns NSBezierPath' has held in practice, but the safe form costs
nothing: switch to `guard let path = copy() as? NSBezierPath else
{ return }` so a runtime mismatch becomes a no-op draw instead of
trapping the process.

The displayID half of PR jordanbaird#956 is intentionally skipped: the patch
introduces a syntax error
(`deviceDescription((deviceDescription[…]` is unbalanced).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant