[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: extragear/graphics/kphotoalbum/AnnotationDialog
From:       Tuomas Suutari <thsuut () utu ! fi>
Date:       2009-11-30 16:47:32
Message-ID: 200911301847.37082.thsuut () utu ! fi
[Download RAW message or body]


Hi,

On Mon 2009-11-30, Hassan Ibraheem wrote:
> 2009/11/30 Jan Kundrát <jkt@gentoo.org>:
> > Hassan Ibraheem wrote:
> >> -      _optionList.setAutoDelete( true );
> >
> > Hi, I don't see any qDeleteAll() in the patch. I haven't looked at
> > the code, but are you sure you do not leak memory here?
> >
> > Cheers,
> > -jkt
> >
> > --
> > cd /local/pub && more beer > /dev/mouth
>
> I thought about that, and as far as I understood, we don't call any
> of the Q3PtrList methods listed here about replacing setAutoDelete:
> http://qt.nokia.com/doc/4.5/porting4.html#qptrlist-t
> We don't remove/replace items from that list anywhere in the code.
> However, maybe I should create a clear() method to be called before
> the delete _annotationDialog;
> in MainWindow/Window.cpp

I think Jan meant the destructor case (note saying "also called from 
QPtrList's destructor" in that URL): When an instance of 
AnnotationDialog::Dialog class is destructed its _optionList member 
gets destructed too. Previously items of _optionList were deleted in 
_optionList's destructor, because of the autoDelete, now this needs to 
be done explictily before the _optionList gets destructed (or cleared 
some other way), probably by calling qDeleteAll(_optionList) in 
AnnotationDialog::Dialog::~Dialog(). (Shouldn't be anything that users 
of the Dialog class should worry about.)

-- 
Tuomas

["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic