diff --git a/Telegram/ThirdParty/SPMediaKeyTap/SPMediaKeyTap.m b/Telegram/ThirdParty/SPMediaKeyTap/SPMediaKeyTap.m index 28d35cbaa..babd0ea02 100644 --- a/Telegram/ThirdParty/SPMediaKeyTap/SPMediaKeyTap.m +++ b/Telegram/ThirdParty/SPMediaKeyTap/SPMediaKeyTap.m @@ -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