Bug fix: Use inotify_rm_watch() rather than close() to remove the Linux joystick watch.

This commit is contained in:
Jonathan Miller 2015-01-23 16:53:41 -05:00
parent 4188c263e3
commit 08b0831b94

View File

@ -277,11 +277,13 @@ void _glfwTerminateJoysticks(void)
regfree(&_glfw.linux_js.regex);
if (_glfw.linux_js.watch > 0)
close(_glfw.linux_js.watch);
if (_glfw.linux_js.inotify > 0)
{
if (_glfw.linux_js.watch > 0)
inotify_rm_watch(_glfw.linux_js.inotify, _glfw.linux_js.watch);
close(_glfw.linux_js.inotify);
}
#endif // __linux__
}