mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-27 04:25:12 +00:00
with this we can set it up at 2 and no memory leaks atm.
This commit is contained in:
parent
dab3eaba7f
commit
33a0681ac8
@ -44,16 +44,16 @@ void PS4_SYSV_ABI sceUsbdExit() {
|
||||
s64 PS4_SYSV_ABI sceUsbdGetDeviceList(SceUsbdDevice*** list) {
|
||||
LOG_DEBUG(Lib_Usbd, "called");
|
||||
|
||||
static ssize_t device_count = 2;
|
||||
ssize_t count = libusb_get_device_list(g_libusb_context, list);
|
||||
if (count < 0)
|
||||
if (count <= 0)
|
||||
return libusb_to_orbis_error((int)count);
|
||||
|
||||
if (count > 2)
|
||||
LOG_WARNING(Lib_Usbd, "Too many USB devices connected to list: {}", count);
|
||||
libusb_unref_device((*list)[2]);
|
||||
count = -1;
|
||||
|
||||
return libusb_to_orbis_error((int)count);
|
||||
if (count != device_count) {
|
||||
LOG_INFO(Lib_Usbd, "Found {} USB devices", count);
|
||||
device_count = count;
|
||||
}
|
||||
return ORBIS_FAIL;
|
||||
}
|
||||
|
||||
void PS4_SYSV_ABI sceUsbdFreeDeviceList(SceUsbdDevice** list, s32 unref_devices) {
|
||||
|
Loading…
Reference in New Issue
Block a user