Merge pull request #6138 from jherico/controllers

Prevent crash on connecting gamepad
This commit is contained in:
Brad Hefta-Gaub 2015-10-21 13:19:09 -07:00
commit 58e5bff9a1

View file

@ -129,6 +129,7 @@ void SDL2Manager::pluginUpdate(float deltaTime, bool jointsCaptured) {
if (!_openJoysticks.contains(id)) {
// Joystick* joystick = new Joystick(id, SDL_GameControllerName(controller), controller);
Joystick* joystick = new Joystick(id, controller);
_openJoysticks[id] = joystick;
userInputMapper->registerDevice(joystick);
emit joystickAdded(joystick);
}