]> git.stg.codes - stg.git/blobdiff - projects/stargazer/traffcounter_impl.cpp
More std::jthread
[stg.git] / projects / stargazer / traffcounter_impl.cpp
index e61be9665b626fefbb5703543a24b749da388324..9b0fd966d9a2732e456b60f176c8200e5bed6ccb 100644 (file)
@@ -128,9 +128,7 @@ users->CloseSearch(h);
 //5 seconds to thread stops itself
 struct timespec ts = {0, 200000000};
 for (int i = 0; i < 25 && !stopped; i++)
-    {
     nanosleep(&ts, NULL);
-    }
 
 if (!stopped)
 {
@@ -138,6 +136,8 @@ if (!stopped)
     return -1;
 }
 
+m_thread.join();
+
 printfd(__FILE__, "TraffCounter::Stop()\n");
 
 return 0;