]> 127.0.0.1 Git - part/.git/commitdiff
回收 v0.4.7
authorqydysky <qydysky@foxmail.com>
Mon, 22 Feb 2021 17:41:17 +0000 (01:41 +0800)
committerqydysky <qydysky@foxmail.com>
Mon, 22 Feb 2021 17:41:17 +0000 (01:41 +0800)
funcCtrl/FuncCtrl.go
funcCtrl/FuncCtrl_test.go

index be2563f09f26d51a8dabd98b121a032c19f55e72..053283e8fe5a568e9d56d14cadc3df86a135b724 100644 (file)
@@ -36,6 +36,10 @@ func (t *FlashFunc) Flash() (current uintptr) {
        return
 }
 
+func (t *FlashFunc) UnFlash() {
+       t.b.Remove(t.b.Back())
+}
+
 func (t *FlashFunc) NeedExit(current uintptr) (bool) {
        return current != t.b.Front().Value.(*idpool.Id).Id
 }
index 801cdae9cc3fb11f2dafb5857a7cbeccac806384..8e331bf5afd5a42e780aa228069124eb84ff6be8 100644 (file)
@@ -24,6 +24,8 @@ func Test_FlashFunc(t *testing.T) {
        var b FlashFunc
        var a = func(i int){
                id := b.Flash()
+               defer b.UnFlash()
+               
                t.Log(i,`.`)
                time.Sleep(time.Second)
                if b.NeedExit(id) {return}