M5MultitouchSupport icon indicating copy to clipboard operation
M5MultitouchSupport copied to clipboard

Crash after sleep

Open ris58h opened this issue 2 years ago • 3 comments

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.

ris58h avatar Jul 29 '22 11:07 ris58h

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().

artginzburg avatar Sep 02 '22 11:09 artginzburg

Maybe interesting?

lwouis avatar Feb 21 '23 22:02 lwouis

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.

ris58h avatar Feb 22 '23 10:02 ris58h