mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-10-29 20:09:44 -04:00
Wait for device updates to complete in cli.cpp rather than just a fixed 1 second wait
This commit is contained in:
1 parent
6c8a6a9125
commit
6a10f77c15
3 files changed
+73
-1
No files matched your search
@@ -1968,7 +1968,16 @@ unsigned int cli_post_detection()
|
||||
}
|
||||
}
|
||||
|
||||
std::this_thread::sleep_for(1s);
|
||||
/*-----------------------------------------------------*\
|
||||
| Wait for each controller's device thread to finish |
|
||||
| applying queued updates to hardware before returning |
|
||||
| so that the updates are not dropped when the |
|
||||
| controllers shut down |
|
||||
\*-----------------------------------------------------*/
|
||||
for(std::size_t controller_idx = 0; controller_idx < rgb_controllers.size(); controller_idx++)
|
||||
{
|
||||
rgb_controllers[controller_idx]->WaitForDeviceUpdate();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user