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

List:       kde-devel
Subject:    Re: Problem with QT
From:       Michael Pyne <michael.pyne () kdemail ! net>
Date:       2005-10-21 21:29:57
Message-ID: 200510211730.02132.michael.pyne () kdemail ! net
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Friday 21 October 2005 11:42, Ivor Hewitt wrote:
> On Wednesday 19 October 2005 16:43, Jimmy Gilles wrote:
> > It works very well but my problem is that when "list" is deleted, keys
> > that are in this list are not deleted. Why ?
> > I use QPointer to automaticaly delete keys but it doesn't work.
>
> Destroying a QPointer does not destroy the object it points to.

And for a perhaps more useful answer, add a destructor for KgpgListKeys that 
iterates over its keys and deletes them.  You might not be able to use 
foreach() since the dtor will be iterating over itself but something like 
this would work:

KgpgListKeys::~KgpgListKeys()
{
  for(ConstIterator it = constBegin(); it != constEnd(); ++it)
  {
    delete *it;
  }
}

Regards,
 - Michael Pyne

[Attachment #5 (application/pgp-signature)]

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


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

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