Skip to content

Commit

Permalink
hiro: prevent exception originating from appkit (#1324)
Browse files Browse the repository at this point in the history
As noted in the Chromium source, the value for
NSTreatUnknownArgumentsAsOpen needs to be of type string despite being a
boolean setting.

If the type is boolean, AppKit throws an exception (which is caught),
but if unwinding fails (observed on some arm64 systems in certain build
configurations when ares is compiled with LTO and -fomit-frame-pointer)
it terminates the whole application.

I've confirmed the behavior the original commit was designed to correct
is still fixed with this change.
  • Loading branch information
invertego authored Dec 4, 2023
1 parent a3222ab commit 5e6afea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hiro/cocoa/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ auto pApplication::run() -> void {
//[[NSRunLoop currentRunLoop] addTimer:applicationTimer forMode:NSEventTrackingRunLoopMode];
}
[[NSUserDefaults standardUserDefaults] registerDefaults:@{
@"NSTreatUnknownArgumentsAsOpen": @NO
//@"NO" is not a mistake; the value really needs to be a string
@"NSTreatUnknownArgumentsAsOpen": @"NO"
}];

@autoreleasepool {
Expand Down

0 comments on commit 5e6afea

Please sign in to comment.