all repos — mgba @ 302b041507c46d5df72bbc01d074b9a1ef5bdea1

mGBA Game Boy Advance Emulator

Qt: Fix crash when initializing gamepads
Jeffrey Pfau jeffrey@endrift.com
Sun, 22 Mar 2015 13:03:14 -0700
commit

302b041507c46d5df72bbc01d074b9a1ef5bdea1

parent

291d5c500b9f6e6fc3a4e1b936b6cdb3457406a5

1 files changed, 2 insertions(+), 1 deletions(-)

jump to
M src/platform/qt/InputController.cppsrc/platform/qt/InputController.cpp

@@ -27,6 +27,7 @@ : QObject(parent)

, m_playerId(playerId) , m_config(nullptr) , m_gamepadTimer(nullptr) + , m_playerAttached(false) { GBAInputMapInit(&m_inputMap);

@@ -102,7 +103,7 @@

const char* InputController::profileForType(uint32_t type) { UNUSED(type); #ifdef BUILD_SDL - if (type == SDL_BINDING_BUTTON) { + if (type == SDL_BINDING_BUTTON && m_sdlPlayer.joystick) { #if SDL_VERSION_ATLEAST(2, 0, 0) return SDL_JoystickName(m_sdlPlayer.joystick); #else