Lock joysticks when adding gamepad mappings
Fixes https://github.com/libsdl-org/SDL/issues/8412main
parent
76f81797b7
commit
70fd8e2ba2
|
@ -1670,6 +1670,8 @@ int SDL_AddGamepadMappingsFromRW(SDL_RWops *src, SDL_bool freesrc)
|
|||
}
|
||||
line = buf;
|
||||
|
||||
SDL_LockJoysticks();
|
||||
|
||||
PushMappingChangeTracking();
|
||||
|
||||
while (line < buf + db_size) {
|
||||
|
@ -1702,6 +1704,8 @@ int SDL_AddGamepadMappingsFromRW(SDL_RWops *src, SDL_bool freesrc)
|
|||
|
||||
PopMappingChangeTracking();
|
||||
|
||||
SDL_UnlockJoysticks();
|
||||
|
||||
SDL_free(buf);
|
||||
return gamepads;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue