Don't crash if SDL functions are passed a closed joystick or gamecontroller

This commit is contained in:
Sam Lantinga
2022-08-30 12:39:23 -07:00
parent 675d90c708
commit 0e4baf1c4e
4 changed files with 257 additions and 142 deletions

View File

@@ -126,8 +126,8 @@ typedef enum
*
* As of SDL 2.26.0, you can take the joystick lock around reinitializing the
* joystick subsystem, to prevent other threads from seeing joysticks in an
* uninitialized state. However, all open joysticks will be closed and calling
* SDL functions using them will potentially cause a crash.
* uninitialized state. However, all open joysticks will be closed and SDL
* functions called with them will fail.
*
* \since This function is available since SDL 2.0.7.
*/