Mercurial > projects > ldc
comparison tangotests/mem4.d @ 209:c4c9b4ac021b trunk
[svn r225] Fixed: delete expressions no longer use llvm's free instruction, which crashes on a GC provided pointer.
author | lindquist |
---|---|
date | Wed, 14 May 2008 01:22:40 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
208:086e1aa99557 | 209:c4c9b4ac021b |
---|---|
1 module tangotests.mem4; | |
2 | |
3 import tango.stdc.stdio; | |
4 | |
5 class C { | |
6 int* ptr; | |
7 this() { | |
8 printf("this()\n"); | |
9 ptr = new int; | |
10 } | |
11 ~this() { | |
12 printf("~this()\n"); | |
13 delete ptr; | |
14 assert(ptr is null); | |
15 } | |
16 final void check() | |
17 { | |
18 printf("check()\n"); | |
19 assert(ptr !is null); | |
20 } | |
21 } | |
22 | |
23 void main() | |
24 { | |
25 C c = new C(); | |
26 c.check(); | |
27 delete c; | |
28 assert(c is null); | |
29 } |