diff --git a/include/brynet/base/Timer.hpp b/include/brynet/base/Timer.hpp index 7c2041a..55e917d 100644 --- a/include/brynet/base/Timer.hpp +++ b/include/brynet/base/Timer.hpp @@ -81,6 +81,11 @@ class RepeatTimer public: using Ptr = std::shared_ptr; + RepeatTimer() + { + mCancel.store(false); + } + void cancel() { mCancel.store(true); @@ -92,7 +97,7 @@ class RepeatTimer } private: - std::atomic_bool mCancel = {false}; + std::atomic_bool mCancel; }; class TimerMgr final : public std::enable_shared_from_this