tasyncleak4.nim 332 B

12345678910111213141516171819202122
  1. discard """
  2. cmd: "nim c --gc:orc -d:useMalloc $file"
  3. output: '''ok'''
  4. valgrind: "leaks"
  5. """
  6. # bug #15076
  7. import asyncdispatch
  8. var futures: seq[Future[void]]
  9. for i in 1..20:
  10. futures.add sleepAsync 1
  11. futures.add sleepAsync 1
  12. futures.all.waitFor()
  13. futures.setLen 0
  14. setGlobalDispatcher nil
  15. GC_fullCollect()
  16. echo "ok"