Skip to content

Commit

Permalink
fps_metrics: fix case where it wouldn't clean up properly
Browse files Browse the repository at this point in the history
  • Loading branch information
flightlessmango committed Nov 4, 2023
1 parent 9411963 commit c51385a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/fps_metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c51385a

Please sign in to comment.