[Digikam-devel] Re: Logic error

Andi Clemens andi.clemens at gmx.net
Sun Nov 21 22:02:53 GMT 2010


Basically since we inherit from QWidget most of the time, a virtual destructor 
should always be used, since QWidget provides virtual methods?
Like I said I converted every destructor to be virtual in my branch and I can 
not see any slowdowns.

Andi Clemens
-----------------
www.digikam.org

On Sunday 21 November 2010 22:27:55 Andi Clemens wrote:
> I added a "virtual" keyword to every destructor now (besides the clases
> from 3rdparty), to make things easier.
> It shouldn't hurt to have virtual destructors, even when no virtual method
> is in the base class.
> 
> But could it have disadvantages? Slowdowns of some kind?
> 
> The advantage would be to get rid of possible memory leaks due to wrong
> destructor callings.
> 
> The patch is in a local branch, I will do further tests, but I'll wait for
> the digiKam 1.6.0 release anyways, so please comment here if you think the
> patch would be wrong and we should only add "virtual" to those classes
> with virtual methods.
> 
> 
> Andi Clemens
> -----------------
> www.digikam.org
> 
> On Sunday 21 November 2010 20:42:21 Andi Clemens wrote:
> > Also we have 448 warnings about classes with virtual methods, but no
> > virtual destructors.
> > 
> > I guess these are valid, I will change this either today or after the
> > 1.6.0 release.
> > 
> > Andi Clemens
> > -----------------
> > www.digikam.org
> > 
> > On Sunday 21 November 2010 16:19:58 Andi Clemens wrote:
> > > Hi,
> > > 
> > > void TemplateSelector::setTemplate(const Template& t) has two return
> > > statements in it, although the return type is void.
> > > 
> > > We should change this.
> > > 
> > > Andi
> > > _______________________________________________
> > > Digikam-devel mailing list
> > > Digikam-devel at kde.org
> > > https://mail.kde.org/mailman/listinfo/digikam-devel
> > 
> > _______________________________________________
> > Digikam-devel mailing list
> > Digikam-devel at kde.org
> > https://mail.kde.org/mailman/listinfo/digikam-devel
> 
> _______________________________________________
> Digikam-devel mailing list
> Digikam-devel at kde.org
> https://mail.kde.org/mailman/listinfo/digikam-devel



More information about the Digikam-devel mailing list