This commit is contained in:
aozhiwei 2024-04-26 11:18:12 +08:00
parent 75b0c72d72
commit 0ec6d9a142

View File

@ -345,6 +345,11 @@ func (this *XTimer) internalDelete(timer *XTimerList, isDestory bool, toFreeList
if !timer.attachEntry.Empty() {
timer.attachEntry.DelInit()
}
for !timer.destoryHandleList.Empty() {
handle := timer.destoryHandleList.FirstEntry().(XTimerDestoryHandleNode)
handle.entry.DelInit()
handle.cb()
}
if isDestory {
timer.cb(TIMER_DESTORY_EVENT, nil)
} else {
@ -355,11 +360,6 @@ func (this *XTimer) internalDelete(timer *XTimerList, isDestory bool, toFreeList
timer.wp.timer = nil
timer.wp = nil
}
for !timer.destoryHandleList.Empty() {
handle := timer.destoryHandleList.FirstEntry().(XTimerDestoryHandleNode)
handle.entry.DelInit()
handle.cb()
}
if toFreeList {
this.addToFreeList(timer)
}