mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-08 16:01:19 +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)
|
if (m_diid == -1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
m_controller = SDL_GameControllerFromInstanceID(m_diid);
|
m_controller = SDL_GameControllerOpen(index);
|
||||||
if (!m_controller)
|
if (!m_controller)
|
||||||
{
|
return false;
|
||||||
m_controller = SDL_GameControllerOpen(index);
|
|
||||||
if (!m_controller)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (const char* name = SDL_GameControllerName(m_controller))
|
if (const char* name = SDL_GameControllerName(m_controller))
|
||||||
m_display_name = name;
|
m_display_name = name;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue