Apply the simple NULL-checking patch from issue 4311.
Judging by the feedback provided by other OSX users, this appears to fix the crash when starting Dolphin on OSX with devices that have an empty name. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7598 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
5bdf27d159
commit
d4d7e2515f
|
@ -137,8 +137,9 @@ static void DeviceMatching_callback(void* inContext,
|
||||||
void *inSender,
|
void *inSender,
|
||||||
IOHIDDeviceRef inIOHIDDeviceRef)
|
IOHIDDeviceRef inIOHIDDeviceRef)
|
||||||
{
|
{
|
||||||
std::string name = [(NSString *)IOHIDDeviceGetProperty(inIOHIDDeviceRef,
|
NSString *pName = (NSString *)
|
||||||
CFSTR(kIOHIDProductKey)) UTF8String];
|
IOHIDDeviceGetProperty(inIOHIDDeviceRef, CFSTR(kIOHIDProductKey));
|
||||||
|
std::string name = (pName != NULL) ? [pName UTF8String] : "Unknown device";
|
||||||
|
|
||||||
DeviceDebugPrint(inIOHIDDeviceRef);
|
DeviceDebugPrint(inIOHIDDeviceRef);
|
||||||
|
|
||||||
|
@ -154,7 +155,7 @@ static void DeviceMatching_callback(void* inContext,
|
||||||
else if (IOHIDDeviceConformsTo(inIOHIDDeviceRef,
|
else if (IOHIDDeviceConformsTo(inIOHIDDeviceRef,
|
||||||
kHIDPage_GenericDesktop, kHIDUsage_GD_Mouse))
|
kHIDPage_GenericDesktop, kHIDUsage_GD_Mouse))
|
||||||
devices->push_back(new Mouse(inIOHIDDeviceRef,
|
devices->push_back(new Mouse(inIOHIDDeviceRef,
|
||||||
name, mouse_name_counts[name++]));
|
name, mouse_name_counts[name]++));
|
||||||
#endif
|
#endif
|
||||||
else
|
else
|
||||||
devices->push_back(new Joystick(inIOHIDDeviceRef,
|
devices->push_back(new Joystick(inIOHIDDeviceRef,
|
||||||
|
|
Loading…
Reference in New Issue