瀏覽代碼

Added clearing of global joystick data.

Camilla Berglund 13 年之前
父節點
當前提交
0c92fb8500
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/cocoa_joystick.m

+ 2 - 0
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)