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.
master
Patrick Snape ago%!(EXTRA string=9 years) committed by Camilla Berglund
parent 25914d381a
commit 74ed35792f
  1. 2
      src/cocoa_init.m

@ -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;
}

Loading…
Cancel
Save