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

List:       kde-core-devel
Subject:    Re: [PATCH] kmail leaking KPopupMenus
From:       Ingo =?iso-8859-1?q?Kl=F6cker?= <kloecker () kde ! org>
Date:       2003-12-30 11:58:39
Message-ID: 200312301258.40727 () erwin ! ingo-kloecker ! de
[Download RAW message or body]


On Tuesday 30 December 2003 11:53, Rolf Magnus wrote:
> On Tuesday 30 December 2003 11:48, Rolf Magnus wrote:
> > Attached is a patch for a small leak in KMail. Whenever you
> > drag/drop a mail into a mail folder, a new KPopupMenu for selection
> > between copy and move is created, but not destroyed. This patch
> > creates the menu once and reuses it.
>
> Hmpf, forgot the header... complete patch attached.

a) IMO the popup should only be created if it's really used so that no 
memory is wasted for people that have disabled the popup. So please 
initialize mDnDPopup with 0 and create it the first time it's used in 
KMFolderTree::contentsDropEvent.

b) You should delete mDnDPopup in the d'tor of KMFolderTree. Otherwise 
we still leak a popup. Note that the user can open several main windows 
(File->New Window) and that each main window would leak one popup.

c) If the popup is created on the stack (as André suggested) then it has 
to be created each time. Since the contents of the popup is static we 
can save the creation time by using Rolf's approach.

Regards,
Ingo

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

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

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