fps_metrics: fix case where it wouldn't clean up properly

winesync
flightlessmango 6 months ago
parent 9411963ad9
commit c51385ab2c

@ -28,10 +28,13 @@ class fpsMetrics {
void calculate(){
thread_init = true;
while (!terminate){
while (true){
std::unique_lock<std::mutex> lock(mtx);
cv.wait(lock, [this] { return run; });
if (terminate)
break;
std::vector<float> sorted_values;
for (const auto& p : fps_stats)
sorted_values.push_back(p.second);

Loading…
Cancel
Save