1
This commit is contained in:
parent
e05caf1d81
commit
3f5fc14407
14
src/timer.rs
14
src/timer.rs
@ -141,7 +141,7 @@ impl Timer {
|
|||||||
let free_timer = |head: &TimerListListHeadRp| {
|
let free_timer = |head: &TimerListListHeadRp| {
|
||||||
while !head.borrow().empty() {
|
while !head.borrow().empty() {
|
||||||
let timer = &head.borrow().first_entry().upgrade().unwrap();
|
let timer = &head.borrow().first_entry().upgrade().unwrap();
|
||||||
//self.detach_timer(timer);
|
self.detach_timer(timer);
|
||||||
if timer.borrow().attach_entry.borrow().empty() {
|
if timer.borrow().attach_entry.borrow().empty() {
|
||||||
timer.borrow().attach_entry.borrow_mut().del_init();
|
timer.borrow().attach_entry.borrow_mut().del_init();
|
||||||
}
|
}
|
||||||
@ -324,6 +324,18 @@ impl Timer {
|
|||||||
self.running_timer = Weak::new();
|
self.running_timer = Weak::new();
|
||||||
}
|
}
|
||||||
self.detach_timer(&*v);
|
self.detach_timer(&*v);
|
||||||
|
match &mut v.borrow_mut().cb {
|
||||||
|
Some(cb) => {
|
||||||
|
if is_destory {
|
||||||
|
(*cb)(TimerEvent::Destory, None);
|
||||||
|
} else {
|
||||||
|
(*cb)(TimerEvent::Delete, None);
|
||||||
|
}
|
||||||
|
v.borrow_mut().cb = None;
|
||||||
|
}
|
||||||
|
None => {
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user