Rockbox mail archiveSubject: Re: Destructors in Theme Editor: virtual or non virtual?
Re: Destructors in Theme Editor: virtual or non virtual?
From: Al Le <al.le_at_gmx.de>
Date: Thu, 17 Jun 2010 22:34:15 +0200
On 17.06.2010 20:11, Robert Bieber wrote:
> [...] but if you inherit from a class that has a non-virtual
> destructor, and then you delete a pointer to the base class which is
> also an instance of the child class, the child class' constructor won't
> be called. Now that someone else has mentioned it, I do think that
> having the original base class constructor virtual makes all the
> following destructors virtual, but it's still safest to just explicitly
> declare them all that way.
I think you confuse constructors and destructors here. Constructors are
never virtual (and cannot be).
Received on 2010-06-17