From 2708aff85370fab3cb64a9f2eea17bac3e9e65a5 Mon Sep 17 00:00:00 2001 From: michi_cc Date: Sun, 17 Nov 2013 12:05:40 +0000 Subject: (svn r26023) -Fix [FS#5805] (r25686): [OSX] Checking for a valid NSTextInputContext is supposed to fail on 10.4 according to docs, but somehow didn't, leading to a crash when an edit box lost focus. --- src/video/cocoa/cocoa_v.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/cocoa/cocoa_v.mm b/src/video/cocoa/cocoa_v.mm index a9f3981d1..df2e7809c 100644 --- a/src/video/cocoa/cocoa_v.mm +++ b/src/video/cocoa/cocoa_v.mm @@ -573,7 +573,7 @@ bool VideoDriver_Cocoa::AfterBlitterChange() void VideoDriver_Cocoa::EditBoxLostFocus() { if (_cocoa_subdriver != NULL) { - if ([ _cocoa_subdriver->cocoaview respondsToSelector:@selector(inputContext) ]) { + if ([ _cocoa_subdriver->cocoaview respondsToSelector:@selector(inputContext) ] && [ [ _cocoa_subdriver->cocoaview performSelector:@selector(inputContext) ] respondsToSelector:@selector(discardMarkedText) ]) { [ [ _cocoa_subdriver->cocoaview performSelector:@selector(inputContext) ] performSelector:@selector(discardMarkedText) ]; } else { [ [ NSInputManager currentInputManager ] markedTextAbandoned:_cocoa_subdriver->cocoaview ]; -- cgit v1.2.3-70-g09d2