]> git.stg.codes - stg.git/blobdiff - projects/stargazer/traffcounter_impl.cpp
Fix XML-RPC module compilation on C++17-only compilers.
[stg.git] / projects / stargazer / traffcounter_impl.cpp
index e61be9665b626fefbb5703543a24b749da388324..377e388902fd26cb493ee241ff54119d57efbe16 100644 (file)
@@ -106,7 +106,7 @@ while (users->SearchNext(h, &u) == 0)
     SetUserNotifiers(u);
 users->CloseSearch(h);
 
-m_thread = std::jthread([this](auto token){ Run(token); });
+m_thread = std::jthread([this](auto token){ Run(std::move(token)); });
 return 0;
 }
 //-----------------------------------------------------------------------------
@@ -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;