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

List:       kde-core-devel
Subject:    Re: [PATCH] kmail leaking KPopupMenus
From:       Don Sanders <sanders () kde ! org>
Date:       2003-12-31 4:36:20
Message-ID: 200312311436.20764.sanders () kde ! org
[Download RAW message or body]

On Tuesday 30 December 2003 21:02, André Wöbbeking 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.

Fair catch.

> why not creating the menu on the stack, i.e.
>
> KPopupMenu menu( this );
> menu.insertItem( i18n("&Move Here"), DRAG_MOVE, 0 );
> ...
> int id = menu.exec( QCursor::pos(), 0 );

A lot less new code, more readable, I like it.

Don.
[prev in list] [next in list] [prev in thread] [next in thread] 

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