зеркало из https://github.com/AvaloniaUI/angle.git
Suppress ObjC exceptions in OSXWindow::messageLoop.
Crashes have been seen inside the Cocoa-internal NS_setFlushesWithDisplayLink function. Web searches indicate this is a regression in macOS 11. See whether catching and ignoring these exceptions improves stability. Bug: angleproject:6570 Change-Id: Id0be68077163bf4e9f98189461eea016a35edd73 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3227697 Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
This commit is contained in:
Родитель
eb9b3f8eb6
Коммит
4d5711291e
|
@ -711,6 +711,11 @@ void OSXWindow::messageLoop()
|
|||
@autoreleasepool
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
// TODO(http://anglebug.com/6570): @try/@catch is a workaround for
|
||||
// exceptions being thrown from Cocoa-internal function
|
||||
// NS_setFlushesWithDisplayLink starting in macOS 11.
|
||||
@try
|
||||
{
|
||||
NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask
|
||||
untilDate:[NSDate distantPast]
|
||||
|
@ -727,6 +732,12 @@ void OSXWindow::messageLoop()
|
|||
}
|
||||
[NSApp sendEvent:event];
|
||||
}
|
||||
@catch (NSException *localException)
|
||||
{
|
||||
NSLog(@"*** OSXWindow discarding exception: <%@> %@", [localException name],
|
||||
[localException reason]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче