Fix resource leak in SPMediaKeyTap.

This commit is contained in:
John Preston 2017-05-09 14:49:31 +03:00
parent 3156dc0f1a
commit d78523e905
1 changed files with 4 additions and 0 deletions

View File

@ -57,6 +57,10 @@ static CGEventRef tapEventCallback(CGEventTapProxy proxy, CGEventType type, CGEv
if(!_app_switching_ref) return;
RemoveEventHandler(_app_switching_ref);
_app_switching_ref = NULL;
if(!_app_terminating_ref) return;
RemoveEventHandler(_app_terminating_ref);
_app_terminating_ref = NULL;
}
-(void)startWatchingMediaKeys