forcing "@nogc" on class destructors

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Fri Jan 23 15:49:03 PST 2015


On Fri, 23 Jan 2015 23:28:28 +0000, Matthias Bentrup wrote:

> If the program ends before the next GC the destructor is never called.
nope.

  class A {
    ~this () { import iv.writer; writeln("dtor"); }
  }

  void main () {
    auto n = new A;
    assert(0);
  }

this outputs "dtor".
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20150123/6c0698e5/attachment.sig>


More information about the Digitalmars-d mailing list