mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Maybe libusb_exit fails when not initialized.
This commit is contained in:
@ -111,10 +111,12 @@ CWII_IPC_HLE_Device_hid::CWII_IPC_HLE_Device_hid(u32 _DeviceID, const std::strin
|
||||
|
||||
CWII_IPC_HLE_Device_hid::~CWII_IPC_HLE_Device_hid()
|
||||
{
|
||||
bool deinit_libusb = false;
|
||||
if (usb_thread_running)
|
||||
{
|
||||
usb_thread_running = false;
|
||||
usb_thread.join();
|
||||
deinit_libusb = true;
|
||||
}
|
||||
|
||||
for ( std::map<u32,libusb_device_handle*>::const_iterator iter = open_devices.begin(); iter != open_devices.end(); ++iter )
|
||||
@ -123,8 +125,8 @@ CWII_IPC_HLE_Device_hid::~CWII_IPC_HLE_Device_hid()
|
||||
}
|
||||
open_devices.clear();
|
||||
|
||||
|
||||
libusb_exit(NULL);
|
||||
if (deinit_libusb)
|
||||
libusb_exit(NULL);
|
||||
}
|
||||
|
||||
bool CWII_IPC_HLE_Device_hid::Open(u32 _CommandAddress, u32 _Mode)
|
||||
|
Reference in New Issue
Block a user