mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-02 14:19:02 +00:00
Slightly better error handling for libusb_init not working.
This commit is contained in:
parent
33761c0b65
commit
aa7319e043
1 changed files with 15 additions and 6 deletions
|
@ -97,16 +97,25 @@ CWII_IPC_HLE_Device_hid::CWII_IPC_HLE_Device_hid(u32 _DeviceID, const std::strin
|
||||||
{
|
{
|
||||||
deviceCommandAddress = 0;
|
deviceCommandAddress = 0;
|
||||||
memset(hidDeviceAliases, 0, sizeof(hidDeviceAliases));
|
memset(hidDeviceAliases, 0, sizeof(hidDeviceAliases));
|
||||||
libusb_init(NULL);
|
int ret = libusb_init(NULL);
|
||||||
|
if (ret)
|
||||||
usb_thread_running = true;
|
{
|
||||||
usb_thread = std::thread(checkUsbUpdates, this);
|
ERROR_LOG(WII_IPC_HID, "libusb_init failed with error: %d", ret);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
usb_thread_running = true;
|
||||||
|
usb_thread = std::thread(checkUsbUpdates, this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CWII_IPC_HLE_Device_hid::~CWII_IPC_HLE_Device_hid()
|
CWII_IPC_HLE_Device_hid::~CWII_IPC_HLE_Device_hid()
|
||||||
{
|
{
|
||||||
usb_thread_running = false;
|
if (usb_thread_running)
|
||||||
usb_thread.join();
|
{
|
||||||
|
usb_thread_running = false;
|
||||||
|
usb_thread.join();
|
||||||
|
}
|
||||||
|
|
||||||
for ( std::map<u32,libusb_device_handle*>::const_iterator iter = open_devices.begin(); iter != open_devices.end(); ++iter )
|
for ( std::map<u32,libusb_device_handle*>::const_iterator iter = open_devices.begin(); iter != open_devices.end(); ++iter )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue