On Sat, 18 Apr 2009 11:24:14 -0400, Leandro Lucarella <llu...@gmail.com> wrote:
I've just found out[1] this[2]:

        The garbage collector is not guaranteed to run the destructor for
        all unreferenced objects.

Is there any reason why D can't guarantee that all finalizers will be
called, at least when the program ends?

Well, a couple of quick tests show that under normal situations (i.e. normal program termination and termination from an exception) the finalizers do run (D2). However, if a finalizer throws an exception, then the rest of the finalizers aren't called. Also, if you call std.c.stdlib.exit, the finalizers won't run.

Reply via email to