destructor ~this() for static "members." , (thanks)

Sclytrack sclytrack at pi.be
Mon Feb 19 02:41:15 PST 2007



> >> The destructor of testb doesn't get called,
> >> before the termination of the application,
> >> or that is at least my perception.
> >>
> > OK, is this supposed to be 'automatic' by the D language definition or a
> > responsibility of the programmer of including an explicit call to testb
> > destructor in the testy one?

== Quote from Derek Parnell (derek at psych.ward)'s article

> It's the programmer responsibility in this situation. I guess you were
> expecting that when the main() function ended, that D would go and call the
> dtor of all the objects still hanging around. Unfortunately, D doesn't do
> that - you need to explictly do that.


Yes, I was kind of expecting that. :-)

Anyways thanks for the examples.


I'm always amazed by the response time in this forum.









More information about the D.gnu mailing list