##destructor is event-driven — what events@@

Destructor fires when…

* AFTER subclass destructor [ISA]
* stackVar going out of scope (automatically destroyed — A U T O variable
** special case — exceptional stack unwinding
* delete
** special case — cascading delete — Host object destructor [HASA]

Now, in the ISA situation all destructors should be virtual, so how does the parent destructor fire? Boris told me child destructor doesn’t need explicit call to parent destructor. System guarantees all destructor fire from descendants to ancestors.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s