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

@@ -68,6 +68,8 @@ typedef struct _SDL_JoystickSensorInfo
struct _SDL_Joystick
{
const void *magic;
SDL_JoystickID instance_id; /* Device instance, monotonically increasing from 0 */
char *name; /* Joystick name - system dependent */
char *path; /* Joystick path - system dependent */