[Solved] Stopping a periodic thread-thing in c++
Sorry, but I didn’t find a design simpler than that. You could, make a class that owns both a thread, and a weak_ptr to itself, to be a “holder” that the callable can see it safely, because the callable will still exists even if the object is destructed. You don’t want a dangling pointer. template<typename … Read more