From 0c92fb8500fb27fb91f24fafc24e5e610196eeca Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Tue, 14 Aug 2012 22:00:11 +0200 Subject: [PATCH] Added clearing of global joystick data. --- src/cocoa_joystick.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cocoa_joystick.m b/src/cocoa_joystick.m index 2c55446c..bf567f86 100644 --- a/src/cocoa_joystick.m +++ b/src/cocoa_joystick.m @@ -340,6 +340,8 @@ void _glfwInitJoysticks(void) CFMutableDictionaryRef hidMatchDictionary = NULL; io_object_t ioHIDDeviceObject = 0; + memset(&_glfwJoysticks, 0, sizeof(_glfwJoysticks)); + result = IOMasterPort(bootstrap_port, &masterPort); hidMatchDictionary = IOServiceMatching(kIOHIDDeviceKey); if (kIOReturnSuccess != result || !hidMatchDictionary)