src/joystick/darwin/SDL_sysjoystick.c
changeset 427 027ae30b867f
parent 297 f6ffac90895c
child 475 429fe382fe4f
equal deleted inserted replaced
426:33712e5d1ec8 427:027ae30b867f
   607 	}
   607 	}
   608 	
   608 	
   609 	/*/ Now search I/O Registry for matching devices. */
   609 	/*/ Now search I/O Registry for matching devices. */
   610 	result = IOServiceGetMatchingServices (masterPort, hidMatchDictionary, &hidObjectIterator);
   610 	result = IOServiceGetMatchingServices (masterPort, hidMatchDictionary, &hidObjectIterator);
   611 	/* Check for errors */
   611 	/* Check for errors */
   612 	if ((kIOReturnSuccess != result) || (NULL == hidObjectIterator))
   612 	if (kIOReturnSuccess != result)
   613 	{
   613 	{
   614 		SDL_SetError("Joystick: Couldn't create a HID object iterator.");
   614 		SDL_SetError("Joystick: Couldn't create a HID object iterator.");
   615 		return -1;
   615 		return -1;
       
   616 	}
       
   617 	if (NULL == hidObjectIterator) /* there are no joysticks */
       
   618 	{
       
   619 		gpDeviceList = NULL;
       
   620 		SDL_numjoysticks = 0;
       
   621 		return 0;
   616 	}
   622 	}
   617 	/* IOServiceGetMatchingServices consumes a reference to the dictionary, so we don't need to release the dictionary ref. */
   623 	/* IOServiceGetMatchingServices consumes a reference to the dictionary, so we don't need to release the dictionary ref. */
   618 
   624 
   619 	/* build flat linked list of devices from device iterator */
   625 	/* build flat linked list of devices from device iterator */
   620 
   626