mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-03 08:28:29 +00:00
Lock joysticks when adding gamepad mappings
Fixes https://github.com/libsdl-org/SDL/issues/8412
This commit is contained in:
@@ -1670,6 +1670,8 @@ int SDL_AddGamepadMappingsFromRW(SDL_RWops *src, SDL_bool freesrc)
|
|||||||
}
|
}
|
||||||
line = buf;
|
line = buf;
|
||||||
|
|
||||||
|
SDL_LockJoysticks();
|
||||||
|
|
||||||
PushMappingChangeTracking();
|
PushMappingChangeTracking();
|
||||||
|
|
||||||
while (line < buf + db_size) {
|
while (line < buf + db_size) {
|
||||||
@@ -1702,6 +1704,8 @@ int SDL_AddGamepadMappingsFromRW(SDL_RWops *src, SDL_bool freesrc)
|
|||||||
|
|
||||||
PopMappingChangeTracking();
|
PopMappingChangeTracking();
|
||||||
|
|
||||||
|
SDL_UnlockJoysticks();
|
||||||
|
|
||||||
SDL_free(buf);
|
SDL_free(buf);
|
||||||
return gamepads;
|
return gamepads;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user