When is a class's destructor called?

Mike Parker aldacron at gmail.com
Sat Dec 28 22:53:13 PST 2013


On 12/29/2013 2:03 PM, Mike wrote:

>
> x's destructor never gets called.  What do I need to implement to have
> the destructor called when x goes out of scope?
>

Class destructors are not called when an object goes out of scope. They 
are called by the garbage collector only when memory needs to be 
reclaimed or during the cleanup cycle during app shutdown.


More information about the Digitalmars-d-learn mailing list