From deed44a4afc219dc1a076c62728eb79f5ce7a1ee Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Fri, 16 May 2014 11:25:34 +0200 Subject: [PATCH] Fixed joystick name dangling pointer. --- README.md | 1 + src/linux_joystick.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 08e51102..7fd42ac5 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,7 @@ The following dependencies are needed by the examples and test programs: - [X11] Bugfix: `glfwDestroyWindow` did not flush the output buffer. - [X11] Bugfix: Window frame interactions were reported as focus events - [X11] Bugfix: Workaround for legacy Compiz caused flickering during resize + - [X11] Bugfix: The name pointer of joysticks were not cleared on disconnection ## Contact diff --git a/src/linux_joystick.c b/src/linux_joystick.c index 5e841686..36de62dc 100644 --- a/src/linux_joystick.c +++ b/src/linux_joystick.c @@ -112,7 +112,8 @@ static void pollJoystickEvents(void) free(_glfw.linux_js[i].axes); free(_glfw.linux_js[i].buttons); free(_glfw.linux_js[i].name); - _glfw.linux_js[i].present = GL_FALSE; + + memset(&_glfw.linux_js[i], 0, sizeof(_glfw.linux_js[i])); } if (result == -1)