Skip to content

Commit 0c6944b

Browse files
moooorgCalcProgrammer1
authored andcommitted
CoolerMaster ARGB controller: fix crash on rescan
1 parent 22b8cdb commit 0c6944b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Controllers/CoolerMasterController/CMARGBcontroller.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ CMARGBController::CMARGBController(hid_device* dev_handle, char *_path, unsigned
3636

3737
CMARGBController::~CMARGBController()
3838
{
39-
hid_close(dev);
39+
if(mutex_ptr.use_count() <= 1)
40+
{
41+
hid_close(dev);
42+
}
4043
}
4144

4245
void CMARGBController::GetStatus()

0 commit comments

Comments
 (0)