mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-11-22 09:09:18 +01:00
SDLController: Do not manually recycle controller instance
SDL_GameControllerFromInstanceID does not increase internal ref counter. Fixes a crash when removing an SDL controller that is in use by another profile
This commit is contained in:
parent
ec6726e85c
commit
3df8217a02
@ -58,13 +58,9 @@ bool SDLController::connect()
|
||||
if (m_diid == -1)
|
||||
return false;
|
||||
|
||||
m_controller = SDL_GameControllerFromInstanceID(m_diid);
|
||||
m_controller = SDL_GameControllerOpen(index);
|
||||
if (!m_controller)
|
||||
{
|
||||
m_controller = SDL_GameControllerOpen(index);
|
||||
if (!m_controller)
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
|
||||
if (const char* name = SDL_GameControllerName(m_controller))
|
||||
m_display_name = name;
|
||||
|
Loading…
Reference in New Issue
Block a user