From 7c4eb1b66b007361ea61b56907b6b5079d1dbad2 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;