HyperXMicrophoneController: avoid race condition, fixes a crash on rescan.
This commit is contained in:
parent
d4b2d3c381
commit
42731a992e
1 changed files with 4 additions and 0 deletions
|
|
@ -34,10 +34,14 @@ HyperXMicrophoneController::HyperXMicrophoneController(hidapi_wrapper hid_wrappe
|
|||
|
||||
HyperXMicrophoneController::~HyperXMicrophoneController()
|
||||
{
|
||||
lock.lock();
|
||||
|
||||
if(dev)
|
||||
{
|
||||
wrapper.hid_close(dev);
|
||||
}
|
||||
|
||||
lock.unlock();
|
||||
}
|
||||
|
||||
std::string HyperXMicrophoneController::GetDeviceLocation()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue