--- Comment #1 from [email protected] 2010-12-14 14:00:42 PST ---
I think it's only because the GC calls the destructor AGAIN, when the
programs
exits. This is as designed. First, the clear() function doesn't delete the
object. Second, the GC calls dtors on all live objects on exit. Thus, the
dtor
is called twice.
So, this bug is likely INVALID.
As for the clear() function, its design is an embarrassment.
I know this is not the case. Try
struct A
{
~this() { writeln("here"); }
}
void main()
{
A a;
clear(a);
}
writes "here" 3 times.