mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-13 11:23:14 +01:00
29 lines
426 B
D
29 lines
426 B
D
module tangotests.mem4;
|
|
|
|
import tango.stdc.stdio;
|
|
|
|
class C {
|
|
int* ptr;
|
|
this() {
|
|
printf("this()\n");
|
|
ptr = new int;
|
|
}
|
|
~this() {
|
|
printf("~this()\n");
|
|
delete ptr;
|
|
assert(ptr is null);
|
|
}
|
|
final void check()
|
|
{
|
|
printf("check()\n");
|
|
assert(ptr !is null);
|
|
}
|
|
}
|
|
|
|
void main()
|
|
{
|
|
C c = new C();
|
|
c.check();
|
|
delete c;
|
|
assert(c is null);
|
|
} |