From b44345d78e1b0331beabeabc283c80826797b860 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 22 Nov 2018 18:25:22 +0530 Subject: [PATCH] Ignore failures to update the NSGL layer Fixes #1168 --- glfw/cocoa_window.m | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/glfw/cocoa_window.m b/glfw/cocoa_window.m index ae0ecce36..b6c634884 100644 --- a/glfw/cocoa_window.m +++ b/glfw/cocoa_window.m @@ -599,8 +599,15 @@ static GLFWapplicationshouldhandlereopenfun handle_reopen_callback = NULL; - (void)updateLayer { - if (window->context.client != GLFW_NO_API) - [window->context.nsgl.object update]; + if (window->context.client != GLFW_NO_API) { + @try { + [window->context.nsgl.object update]; + } @catch (NSException *e) { + _glfwInputError(GLFW_PLATFORM_ERROR, + "Failed to update NSGL Context object with error: %s (%s)", + [[e name] UTF8String], [[e reason] UTF8String]); + } + } _glfwInputWindowDamage(window); }