improve the timer that it can be deleted in elapse handler

This commit is contained in:
Jinhao
2019-09-01 18:49:19 +08:00
parent e37cc5ec37
commit 8323064efc
2 changed files with 13 additions and 9 deletions

View File

@@ -48,7 +48,7 @@ namespace nana
template<typename Function>
void elapse(Function && fn)
{
elapse_.connect(std::forward<Function>(fn));
elapse_->connect(std::forward<Function>(fn));
}
void reset();
@@ -66,7 +66,7 @@ namespace nana
private:
unsigned _m_interval() const;
private:
nana::basic_event<arg_elapse> elapse_;
std::shared_ptr<nana::basic_event<arg_elapse>> elapse_;
implement * const impl_;
};
}//end namespace nana