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 all the listener is unbound from all observation pools
correctly. I can confirm that this fixes #817 for me.

https://developer.apple.com/reference/foundation/nsdistributednotificationcenter/1416236-removeobserver?language=objc
This commit is contained in:
Patrick Snape 2016-08-08 12:34:58 +02:00
parent 25914d381a
commit 16a334e857

View File

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