Release quartz event tap in screen Dtor
This commit is contained in:
parent
d770160e00
commit
6368207dec
|
@ -251,6 +251,13 @@ OSXScreen::~OSXScreen()
|
||||||
delete m_keyState;
|
delete m_keyState;
|
||||||
delete m_screensaver;
|
delete m_screensaver;
|
||||||
|
|
||||||
|
if (m_eventTapRLSR) {
|
||||||
|
LOG((CLOG_DEBUG "releasing quartz event tap"));
|
||||||
|
CFRunLoopRemoveSource(CFRunLoopGetCurrent(), m_eventTapRLSR, kCFRunLoopDefaultMode);
|
||||||
|
CFRelease(m_eventTapRLSR);
|
||||||
|
m_eventTapRLSR = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_eventTapPort) {
|
if (m_eventTapPort) {
|
||||||
CGEventTapEnable(m_eventTapPort, false);
|
CGEventTapEnable(m_eventTapPort, false);
|
||||||
CFRelease(m_eventTapPort);
|
CFRelease(m_eventTapPort);
|
||||||
|
@ -755,20 +762,7 @@ OSXScreen::disable()
|
||||||
showCursor();
|
showCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME -- stop watching jump zones, stop capturing input
|
// FIXME -- stop watching jump zones, stop capturing input
|
||||||
|
|
||||||
if (m_eventTapRLSR) {
|
|
||||||
LOG((CLOG_DEBUG "releasing quartz event tap"));
|
|
||||||
CFRunLoopRemoveSource(CFRunLoopGetCurrent(), m_eventTapRLSR, kCFRunLoopDefaultMode);
|
|
||||||
CFRelease(m_eventTapRLSR);
|
|
||||||
m_eventTapRLSR = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_eventTapPort) {
|
|
||||||
CGEventTapEnable(m_eventTapPort, false);
|
|
||||||
CFRelease(m_eventTapPort);
|
|
||||||
m_eventTapPort = nullptr;
|
|
||||||
}
|
|
||||||
// FIXME -- allow system to enter power saving mode
|
// FIXME -- allow system to enter power saving mode
|
||||||
|
|
||||||
// disable drag handling
|
// disable drag handling
|
||||||
|
|
Loading…
Reference in New Issue