M5MultitouchSupport
M5MultitouchSupport copied to clipboard
Crash after sleep
I get EXC_BAD_INSTRUCTION
when laptop wakes up after sleep.
Stack trace:
#0 0x00007ff817e8a02a in _CFRelease.cold.3 ()
#1 0x00007ff817e1e541 in _CFRelease ()
#2 0x000000010e2c5a1a in -[M5MultitouchManager stopHandlingMultitouchEvents] at PROJECT_DIR/Pods/M5MultitouchSupport/M5MultitouchSupport/M5MultitouchManager.m:236
#3 0x000000010e2c5b78 in __55-[M5MultitouchManager restartHandlingMultitouchEvents:]_block_invoke at PROJECT_DIR/Pods/M5MultitouchSupport/M5MultitouchSupport/M5MultitouchManager.m:241
It seems like it's an issue with MTDeviceRelease(mtDevice); line. When I comment out this line it works fine.
Looks like MTDeviceRelease() sort of happens automatically on system sleep, and an object can't be released twice.
I bet the same error will be thrown if you try running MTDeviceRelease() before MTRegisterContactFrameCallback() and MTDeviceStart().
I've found out that checking that device is running as it's done in OpenMultitouchSupport ~~prevents from a crash after sleep~~ DOESN'T HELP.
UPDATE: I've checked one more time and the issue is still here. Only not releasing a device works for me as it's done in Touch-Tab.