summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2017-04-16 20:52:40 +0200
committerEugen Wissner <belka@caraus.de>2017-04-16 20:52:40 +0200
commit9a4c8cea06a3ba901f934963f623395f9d7ae44e (patch)
treea3678ece0d35d4849afb42330bd2168e58fb3827
parent4b1cd2cbfd0ae9a3cfa598cb54a86c8e39a9763a (diff)
parenteb360bda387063d970669bf2683dca484a673cea (diff)
downloadtanya-9a4c8cea06a3ba901f934963f623395f9d7ae44e.tar.gz
Merge branch 'master' into utf8string
-rw-r--r--source/tanya/memory/types.d17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/tanya/memory/types.d b/source/tanya/memory/types.d
index af0f1ac..4efb1ca 100644
--- a/source/tanya/memory/types.d
+++ b/source/tanya/memory/types.d
@@ -495,3 +495,20 @@ private @nogc unittest
auto rc = defaultAllocator.refCounted!(int[])(5);
assert(rc.length == 5);
}
+
+private @nogc unittest
+{
+ static bool destroyed = false;
+
+ struct F
+ {
+ ~this() @nogc
+ {
+ destroyed = true;
+ }
+ }
+ {
+ auto rc = defaultAllocator.refCounted!F();
+ }
+ assert(destroyed);
+}