diff options
| author | Eugen Wissner <belka@caraus.de> | 2017-04-16 20:52:40 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2017-04-16 20:52:40 +0200 |
| commit | 9a4c8cea06a3ba901f934963f623395f9d7ae44e (patch) | |
| tree | a3678ece0d35d4849afb42330bd2168e58fb3827 | |
| parent | 4b1cd2cbfd0ae9a3cfa598cb54a86c8e39a9763a (diff) | |
| parent | eb360bda387063d970669bf2683dca484a673cea (diff) | |
| download | tanya-9a4c8cea06a3ba901f934963f623395f9d7ae44e.tar.gz | |
Merge branch 'master' into utf8string
| -rw-r--r-- | source/tanya/memory/types.d | 17 |
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); +} |
