mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-02-25 20:46:48 +00:00
Don't trigger an error if we try to delete a touch device after shutting down the touch system
This can happen on Raspberry Pi if the display system fails to initialize.
This commit is contained in:
parent
81479d8784
commit
ea4ea27a59
|
@ -456,10 +456,16 @@ SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window,
|
||||||
void
|
void
|
||||||
SDL_DelTouch(SDL_TouchID id)
|
SDL_DelTouch(SDL_TouchID id)
|
||||||
{
|
{
|
||||||
int i;
|
int i, index;
|
||||||
int index = SDL_GetTouchIndex(id);
|
SDL_Touch *touch;
|
||||||
SDL_Touch *touch = SDL_GetTouch(id);
|
|
||||||
|
|
||||||
|
if (SDL_num_touch == 0) {
|
||||||
|
/* We've already cleaned up, we won't find this device */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
index = SDL_GetTouchIndex(id);
|
||||||
|
touch = SDL_GetTouch(id);
|
||||||
if (!touch) {
|
if (!touch) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue