mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-20 22:16:49 +01:00
Fixed crash on macOS when AirPods are connected
This commit is contained in:
parent
38b61a3dfa
commit
1133ea0349
@ -252,6 +252,9 @@ static int get_string_property(IOHIDDeviceRef device, CFStringRef prop, wchar_t
|
|||||||
if (!len)
|
if (!len)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
if (CFGetTypeID(prop) != CFStringGetTypeID())
|
||||||
|
return 0;
|
||||||
|
|
||||||
str = (CFStringRef)IOHIDDeviceGetProperty(device, prop);
|
str = (CFStringRef)IOHIDDeviceGetProperty(device, prop);
|
||||||
|
|
||||||
buf[0] = 0;
|
buf[0] = 0;
|
||||||
@ -288,6 +291,9 @@ static int get_string_property_utf8(IOHIDDeviceRef device, CFStringRef prop, cha
|
|||||||
if (!len)
|
if (!len)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
if (CFGetTypeID(prop) != CFStringGetTypeID())
|
||||||
|
return 0;
|
||||||
|
|
||||||
str = (CFStringRef)IOHIDDeviceGetProperty(device, prop);
|
str = (CFStringRef)IOHIDDeviceGetProperty(device, prop);
|
||||||
|
|
||||||
buf[0] = 0;
|
buf[0] = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user