diff --git a/src/smartools.cpp b/src/smartools.cpp index 5325af727f91665f0778f98029803d0f3f7b1af1..c6b756cfb98ab23e8c36f13c4006b18230cf627a 100644 --- a/src/smartools.cpp +++ b/src/smartools.cpp @@ -39,6 +39,11 @@ Smartools::Smartools() : loop_([this] { return true; }, [this] { process(); }, [] {}) {} +Smartools::~Smartools() +{ + loop_.join(); +} + void Smartools::sendInfo() { diff --git a/src/smartools.h b/src/smartools.h index 0d9a1f642de21f97f43a11a9334e429786299bdf..23af6e1aad8de47890e776d253a81630cb92e330 100644 --- a/src/smartools.h +++ b/src/smartools.h @@ -40,6 +40,7 @@ class Smartools private: Smartools(); + ~Smartools(); void process(); std::map<std::string, std::string> information_; std::mutex mutexInfo_; // Protect information_ from multithreading