Skip to content

Commit

Permalink
Maybe libusb_exit fails when not initialized.
Browse files Browse the repository at this point in the history
  • Loading branch information
Parlane committed Aug 26, 2013
1 parent aa7319e commit 8006c87
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_hid.cpp
Expand Up @@ -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 )
Expand All @@ -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)
Expand Down

0 comments on commit 8006c87

Please sign in to comment.