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;
|
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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue