scope attribute and catching exception
arathorn at fastwebnet.it
Mon Oct 13 03:05:59 PDT 2008
Denis Koroskin Wrote:
> Looks like no destructor is called if ctor throws an exception.
> Try throwing outside of it and see what happens.
In that case everything is ok. So it's a bug?
// In this case everything it's ok
scope r1 = new Resource();
scope r2 = new Resource();
throw new Exception("bang");
assert( Resource.allocated == 0); // Expected
More information about the Digitalmars-d-learn