diff options
-rw-r--r-- | xbmc/platform/darwin/peripherals/Input_Gamecontroller.mm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/xbmc/platform/darwin/peripherals/Input_Gamecontroller.mm b/xbmc/platform/darwin/peripherals/Input_Gamecontroller.mm index ec39c0700e..4b8f17dcca 100644 --- a/xbmc/platform/darwin/peripherals/Input_Gamecontroller.mm +++ b/xbmc/platform/darwin/peripherals/Input_Gamecontroller.mm @@ -200,6 +200,7 @@ struct PlayerControllerState - (void)microValueChangeHandler:(GCController*)controller { + auto __unsafe_unretained controllerInBlock = controller; controller.microGamepad.valueChangedHandler = ^(GCMicroGamepad* gamepad, GCControllerElement* element) { NSString* message; @@ -233,7 +234,7 @@ struct PlayerControllerState message = [self checkdpad:gamepad.dpad withEvent:&newEvent withInputInfo:InputValueInfo{GCCONTROLLER_TYPE::MICRO} - withplayerIndex:static_cast<int>(controller.playerIndex)]; + withplayerIndex:static_cast<int>(controllerInBlock.playerIndex)]; } if (@available(iOS 13.0, tvOS 13.0, macOS 10.15, *)) { |