优先定时器释放问题

This commit is contained in:
boyce
2020-09-02 20:23:37 +08:00
parent f8b52b4216
commit bdf8fd492a

View File

@@ -72,6 +72,9 @@ func (disp *Dispatcher) AfterFuncEx(funName string,d time.Duration, cbex func(ti
t.name = funName//reflect.TypeOf(cbex).Name() t.name = funName//reflect.TypeOf(cbex).Name()
//t.name = runtime.FuncForPC(reflect.ValueOf(cbex).Pointer()).Name() //t.name = runtime.FuncForPC(reflect.ValueOf(cbex).Pointer()).Name()
t.t = time.AfterFunc(d, func() { t.t = time.AfterFunc(d, func() {
if disp == nil {
return
}
disp.ChanTimer <- t disp.ChanTimer <- t
}) })
return t return t