Cocoa: Add missing call to removeObserver:

As noted in the documentation for NSDistributedNotificationCenter,
(under the Discussion heading) before an observer is deallocated a call
should be made to removeObserver: in order to ensure that the listener
is correctly removed from all observation pools.

Fixes #817.
Closes #826.
This commit is contained in:
Patrick Snape 2016-08-08 12:34:58 +02:00 committed by Camilla Berglund
parent 25914d381a
commit 74ed35792f

View File

@ -359,6 +359,8 @@ void _glfwPlatformTerminate(void)
removeObserver:_glfw.ns.listener
name:(__bridge NSString*)kTISNotifySelectedKeyboardInputSourceChanged
object:nil];
[[NSDistributedNotificationCenter defaultCenter]
removeObserver:_glfw.ns.listener];
[_glfw.ns.listener release];
_glfw.ns.listener = nil;
}