summary refs log tree commit diff stats
path: root/tests/arc/tasyncleak4.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2020-11-26 10:24:52 +0100
committerGitHub <noreply@github.com>2020-11-26 10:24:52 +0100
commitda753c6a2eded5a382faf22dbf2a2ec1b1fc328f (patch)
tree6bfa2a4fb8f37cd320cbec8a7aae0c311bc84986 /tests/arc/tasyncleak4.nim
parent3e7077ac7d2f4867ecabff09b730b6bc9356979d (diff)
downloadNim-da753c6a2eded5a382faf22dbf2a2ec1b1fc328f.tar.gz
fixes #15076 (#16143)
* fixes #15076

* heapqueue: optimized for ARC

* added another test case [backport:1.4]

* code cleanup
Diffstat (limited to 'tests/arc/tasyncleak4.nim')
-rw-r--r--tests/arc/tasyncleak4.nim21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/arc/tasyncleak4.nim b/tests/arc/tasyncleak4.nim
new file mode 100644
index 000000000..58cd7f0b7
--- /dev/null
+++ b/tests/arc/tasyncleak4.nim
@@ -0,0 +1,21 @@
+discard """
+  cmd: "nim c --gc:orc -d:useMalloc $file"
+  output: '''ok'''
+  valgrind: "leaks"
+"""
+
+# bug #15076
+import asyncdispatch
+
+var futures: seq[Future[void]]
+
+for i in 1..20:
+  futures.add sleepAsync 1
+  futures.add sleepAsync 1
+
+  futures.all.waitFor()
+  futures.setLen 0
+
+setGlobalDispatcher nil
+GC_fullCollect()
+echo "ok"