Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: Destructors in Theme Editor: virtual or non virtual?

Re: Destructors in Theme Editor: virtual or non virtual?

From: pouly amaury <amaury.pouly_at_gmail.com>
Date: Thu, 17 Jun 2010 11:39:48 +0200

> Out of curiosity I looked at the code of the Theme Editor which is written
> in C++. And saw, e.g. in the class SkinViewer, that the destructor is
> declared as a non-virtual function. But shouldn't (almost always)
> destructors be declared as virtual functions so that the framework (Qt in
> this case) can correctly destroy custom objects?<http://portal.gmx.net/de/go/dsl>

You are perfectly right. When deriving from a class, the destructor should
always be virtual in order to call the destructor of the base class.
Received on 2010-06-17


Page was last modified "Jan 10 2012" The Rockbox Crew
aaa