From c7943c82b2c3a61cf616a4f3fe38d83f47d33bfd Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Wed, 1 Aug 2018 21:25:09 +0200 Subject: [PATCH] macosx: SPMediaKeyTap: Clean up comments --- modules/gui/macosx/SPMediaKeyTap.m | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/gui/macosx/SPMediaKeyTap.m b/modules/gui/macosx/SPMediaKeyTap.m index 275b34c212..766e591e8b 100644 --- a/modules/gui/macosx/SPMediaKeyTap.m +++ b/modules/gui/macosx/SPMediaKeyTap.m @@ -56,6 +56,7 @@ static CGEventRef tapEventCallback(CGEventTapProxy proxy, CGEventType type, CGEv #pragma mark - #pragma mark Setup and teardown + - (id)initWithDelegate:(id)delegate { self = [super init]; @@ -127,22 +128,23 @@ static CGEventRef tapEventCallback(CGEventTapProxy proxy, CGEventType type, CGEv - (void)stopWatchingMediaKeys { - // TODO: Shut down thread, remove event tap port and source - + // Shut down tap thread if(_tapThreadRL){ CFRunLoopStop(_tapThreadRL); - _tapThreadRL=nil; + _tapThreadRL = nil; } + // Remove tap port if(_eventPort){ CFMachPortInvalidate(_eventPort); CFRelease(_eventPort); - _eventPort=nil; + _eventPort = nil; } + // Remove tap source if(_eventPortSource){ CFRelease(_eventPortSource); - _eventPortSource=nil; + _eventPortSource = nil; } } -- 2.11.4.GIT