diff --git a/examples/main.go b/examples/main.go index 413cb36..bbf7457 100644 --- a/examples/main.go +++ b/examples/main.go @@ -47,6 +47,8 @@ func demoFunc() error { } func main() { + defer ants.Release() + runTimes := 1000 // use the common pool @@ -70,6 +72,7 @@ func main() { wg.Done() return nil }) + defer p.Release() // submit tasks for i := 0; i < runTimes; i++ { wg.Add(1)