got it! (Re: Kicker memory leaks)

Josef Weidendorfer Josef.Weidendorfer at gmx.de
Wed May 8 23:56:40 BST 2002


Hi,

a follow-up:
I looked into the KDirWatch problem with PanelBrowserMenu again,
because the KDirWatch instance should have been deleted even
before my patch, and I found the real problem:
NO PanelBrowserMenu instance is deleted at all, my patch changes
nothing about the memory leak (OK: the menu regeneration are
a lot less now).
Reason: The manual of
 QPopupMenu::insertItem(*,*,QPopupMenu)
that is used for inserting new menus states, that inserted submenus
aren't deleted when clearing the menu! Thus, submenus exist as long
as the parent exists, and as the top parent is kicker itself, the QObject
cleanup happens only at kicker termination; all the submenus which are
regenerated on a KDirWatch event, are NEVER deleted till termination!

Attached patch:
- PanelBrowserMenu::slotClear reimplements KPanelMenu::slotClear
  and correctly delete the submenus (Question: should submenu
  deletion handling be done in KPanelMenu, as this deletion bug probably
  exists for the K-Menu too ?!??).
- KDirWatch events simply call slotClear; this is much better than
  regenerating menus that aren't visible at all. The menus are always
  regenerated if needed before they are shown (slotAboutToShow calls
  initialize() !)
- Menus should NOT be changed when shown. When shown, a change
  is marked in a dirty flag. When the menu is shown the next time,
  the menu is updated before (in initialize()).
- Start KDirWatch as late as possible (in initialize()), and remove
  it as early as possible (in slotClear())

This leads to a much saner behaviour now. Note that opening a
quickbrowser on /proc/self or on /tmp while compiling rendered
kicker useless before this change.

Please check and commit to BRANCH and HEAD again :-)

Cheers,
Josef


On Wednesday 08 May 2002 18:27, Matthias Elter wrote:
> On Wednesday 08 May 2002 17:54, Josef Weidendorfer wrote:
> > Can somebody check and apply to BRANCH and HEAD?
> > (Perhaps even for KDE 3.0.1)
>
> Done, thanks.
>
> Matthias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kicker.diff
Type: text/x-diff
Size: 5377 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20020509/3b6baca2/attachment.diff>


More information about the kde-core-devel mailing list