mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-09 00:11:17 +12: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
1 changed files with 2 additions and 6 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue