mirror of
https://github.com/glfw/glfw.git
synced 2025-10-05 06:06:36 +00:00
Avoid crash by using _glfwPlatformPollJoystick() as intended in joystick diconnection code.
This commit is contained in:
parent
5779a3dfc5
commit
0e8620f8a0
@ -576,11 +576,14 @@ void _glfwDetectJoystickConnectionWin32(void)
|
|||||||
void _glfwDetectJoystickDisconnectionWin32(void)
|
void _glfwDetectJoystickDisconnectionWin32(void)
|
||||||
{
|
{
|
||||||
int jid;
|
int jid;
|
||||||
|
_GLFWjoystick* js;
|
||||||
|
|
||||||
for (jid = 0; jid <= GLFW_JOYSTICK_LAST; jid++)
|
for (jid = 0; jid <= GLFW_JOYSTICK_LAST; jid++)
|
||||||
{
|
{
|
||||||
if (_glfw.joysticks[jid].present)
|
js = &_glfw.joysticks[jid];
|
||||||
_glfwPlatformPollJoystick(jid, _GLFW_POLL_PRESENCE);
|
|
||||||
|
if (js->present)
|
||||||
|
_glfwPlatformPollJoystick(js, _GLFW_POLL_PRESENCE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user