Fix joystick user pointer NULL during disconnect

The joystick code did not distinguish between the allocation status of
the GLFW joystick object and whether it is connection to an OS level
joystick object.

These are now tracked separately.

Fixes #2092
This commit is contained in:
Camilla Löwy
2022-05-05 22:23:12 +02:00
parent e9c58bc181
commit 2c204ab52e
7 changed files with 40 additions and 31 deletions
+2 -1
View File
@@ -634,7 +634,8 @@ struct _GLFWmapping
//
struct _GLFWjoystick
{
GLFWbool present;
GLFWbool allocated;
GLFWbool connected;
float* axes;
int axisCount;
unsigned char* buttons;