Commit 267207ffca64dac5afc96096019f976de7871db1

Sam Lantinga 2016-10-18T23:12:45

Worked around a crash on Mac OS X 10.10 and earlier, thanks to Eric Wasylishen.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/src/video/cocoa/SDL_cocoakeyboard.m b/src/video/cocoa/SDL_cocoakeyboard.m
index 2ad7bc3..91267e5 100644
--- a/src/video/cocoa/SDL_cocoakeyboard.m
+++ b/src/video/cocoa/SDL_cocoakeyboard.m
@@ -235,7 +235,12 @@ QuitHIDCallback()
     IOHIDManagerUnscheduleFromRunLoop(s_hidManager, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
     IOHIDManagerRegisterInputValueCallback(s_hidManager, NULL, NULL);
     IOHIDManagerClose(s_hidManager, 0);
+
+#if 0 /* Releasing here causes a crash on Mac OS X 10.10 and earlier,
+       * so just leak it for now. See bug 2157 for details.
+       */
     CFRelease(s_hidManager);
+#endif
     s_hidManager = NULL;
 }