Skip to content

Commit a0075bd

Browse files
committed
apple: mfi: attempted controller disconnect fix
1 parent b3e0897 commit a0075bd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

input/drivers_joypad/mfi_joypad.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -460,9 +460,9 @@ - (void)shutdown
460460
{
461461
if (@available(iOS 14, tvOS 14, macOS 11, *))
462462
{
463-
if (_weakPlayer) [_weakPlayer cancelAndReturnError:nil];
464-
if (_strongPlayer) [_strongPlayer cancelAndReturnError:nil];
465-
463+
/* When controller disconnects, the haptic engine is already stopped
464+
* by the system, so don't bother trying to cancel players - just
465+
* clear the handlers and release everything. */
466466
for (CHHapticEngine *eng in self.engines)
467467
{
468468
eng.stoppedHandler = ^(CHHapticEngineStoppedReason reason) {};

0 commit comments

Comments
 (0)