Version 1.3.7: Possible bug fix.

Attempt to fix strange crash in SPMediaKeyTap.
This commit is contained in:
John Preston 2018-06-11 22:23:15 +03:00
parent e60311811b
commit b5bc7a22af

View file

@ -77,7 +77,10 @@ static CGEventRef tapEventCallback(CGEventTapProxy proxy, CGEventType type, CGEv
CGEventMaskBit(NX_SYSDEFINED),
tapEventCallback,
self);
assert(_eventPort != NULL);
if (!_eventPort) {
[self stopWatchingMediaKeys];
return;
}
_eventPortSource = CFMachPortCreateRunLoopSource(kCFAllocatorSystemDefault, _eventPort, 0);
assert(_eventPortSource != NULL);