From 7b86bca0985f34952b6291a55e5ee26dd142b1a8 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 29 Oct 2016 15:52:06 +0200 Subject: [PATCH] Fixed: Catch exception when calling [NSApp sendEvent:event] and log it --- .../src/3d/driver/opengl/mac/cocoa_event_emitter.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/code/nel/src/3d/driver/opengl/mac/cocoa_event_emitter.cpp b/code/nel/src/3d/driver/opengl/mac/cocoa_event_emitter.cpp index 478b8f444..f33667082 100644 --- a/code/nel/src/3d/driver/opengl/mac/cocoa_event_emitter.cpp +++ b/code/nel/src/3d/driver/opengl/mac/cocoa_event_emitter.cpp @@ -442,8 +442,15 @@ void CCocoaEventEmitter::submitEvents(CEventServer& server, bool /* allWins */) processMessage(event, &server); } - // forward the event to the cocoa application - [NSApp sendEvent:event]; + @try + { + // forward the event to the cocoa application + [NSApp sendEvent:event]; + } + @catch(NSException *e) + { + nlwarning("Exception when sending event: %s", [[e reason] UTF8String]); + } } _server = &server;