mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-26 04:31:37 +08:00
确保能同步取消定时器
This commit is contained in:
parent
341bb5d84a
commit
7272f01ea9
@ -70,10 +70,10 @@ public:
|
|||||||
|
|
||||||
void start(int ms ,EventPoller &poller){
|
void start(int ms ,EventPoller &poller){
|
||||||
weak_ptr<TimerForC> weak_self = shared_from_this();
|
weak_ptr<TimerForC> weak_self = shared_from_this();
|
||||||
poller.doDelayTask(ms, [weak_self](){
|
_task = poller.doDelayTask(ms, [weak_self]() {
|
||||||
auto strong_self = weak_self.lock();
|
auto strong_self = weak_self.lock();
|
||||||
if(!strong_self){
|
if (!strong_self) {
|
||||||
return (uint64_t)0;
|
return (uint64_t) 0;
|
||||||
}
|
}
|
||||||
return (*strong_self)();
|
return (*strong_self)();
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user