mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-23 15:35:46 +00:00
input_common: Fix crash when controller disconnects
This commit is contained in:
parent
b41d05a12c
commit
2d3df5d3f4
1 changed files with 3 additions and 1 deletions
|
@ -267,7 +267,9 @@ void SDLState::CloseJoystick(SDL_Joystick* sdl_joystick) {
|
||||||
return joystick->GetSDLJoystick() == sdl_joystick;
|
return joystick->GetSDLJoystick() == sdl_joystick;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (joystick_it != joystick_guid_list.end()) {
|
||||||
(*joystick_it)->SetSDLJoystick(nullptr, nullptr);
|
(*joystick_it)->SetSDLJoystick(nullptr, nullptr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SDLState::HandleGameControllerEvent(const SDL_Event& event) {
|
void SDLState::HandleGameControllerEvent(const SDL_Event& event) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue