From f35a9328e000ea26c7ab08a7386c45645a106158 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 11 May 2013 12:21:33 +0000 Subject: [PATCH] Fix for previous fix, not sure it will cause issues in practice but better be sure to avoid invalid memory access. --- intern/ghost/intern/GHOST_WindowCocoa.mm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm index 9e01fdbf332..b8d52a2b4ff 100644 --- a/intern/ghost/intern/GHOST_WindowCocoa.mm +++ b/intern/ghost/intern/GHOST_WindowCocoa.mm @@ -283,6 +283,8 @@ extern "C" { // The trick to prevent Cocoa from complaining (beeping) - (void)keyDown:(NSEvent *)event { + systemCocoa->handleKeyEvent(event); + /* Start or continue composing? */ if ([[event characters] length] == 0 || [[event charactersIgnoringModifiers] length] == 0 || @@ -297,9 +299,8 @@ extern "C" { [self interpretKeyEvents:events]; // calls insertText [events removeObject:event]; [events release]; + return; } - - systemCocoa->handleKeyEvent(event); } - (void)keyUp:(NSEvent *)event