view tangotests/mem4.d @ 245:d61ce72c39ab trunk

[svn r262] Fixed debug info for normal function parameters. Fixed debug info for pointers to basic types.
author lindquist
date Mon, 09 Jun 2008 12:43:16 +0200
parents c4c9b4ac021b
children
line wrap: on
line source

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);
}