Bug 181784 - Leaks three X windows when context menu is opened
Summary: Leaks three X windows when context menu is opened
Status: RESOLVED UNMAINTAINED
Alias: None
Product: konqueror
Classification: Applications
Component: general (show other bugs)
Version: 3.5
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-24 19:04 UTC by olig9
Modified: 2012-06-18 18:22 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description olig9 2009-01-24 19:04:46 UTC
Version:           3.5.9 (using KDE 3.5.10)
OS:                Linux
Installed from:    Debian testing/unstable Packages

When right-clicking in a Konqueror window (no matter whether filemanagement or web browser), Konqueror apparently creates 8 X windows (with XCreateSimpleWindow, as children of the root window) but only destroys 5 of them when the menu is closed. It looks like the remaining 3 windows keep existing until this Konqueror instance is closed. The windows belong to the Open With, Preview and Actions submenus.

The leak can be seen by running `xwininfo -root -children | wc -l` before and after right-clicking in a Konqueror window - the number of windows reliably increases.

Unfortunately I could not see the leak in Valgrind, because the QWidget destructor (for QMainWindow) destroys all its children when the Konqueror instance is closed, so for Valgrind everything looks fine in the end :-(

I did not verify in detail if the leaked windows are really never closed; but `xwininfo -root -children | grep "840x420+420+315" | wc -l` currently shows that 6748 windows with these curious coordinates and size are existing on my system, and the attributes exactly match those of the leaked windows.

Here are two patches which together fix the problem for me:

--- kdebase-orig/kdebase-3.5.9.dfsg.1/konqueror/konq_mainwindow.cc	2007-10-08 11:51:30.000000000 +0200
+++ kdebase/kdebase-3.5.9.dfsg.1/konqueror/konq_mainwindow.cc	2009-01-24 01:05:25.000000000 +0100
@@ -4740,6 +4740,9 @@
   QGuardedPtr<QObject> guard(this); // #149736
   pPopupMenu->exec( _global );
 
+  pPopupMenu->factory()->removeClient( konqyMenuClient );
   delete pPopupMenu;
 
   // We're sort of misusing KActionCollection here, but we need it for the actionStatusText signal...


--- kdebase-orig/kdebase-3.5.9.dfsg.1/libkonq/konq_popupmenu.cc	2007-10-08 11:51:30.000000000 +0200
+++ kdebase/kdebase-3.5.9.dfsg.1/libkonq/konq_popupmenu.cc	2009-01-24 01:31:18.000000000 +0100
@@ -999,6 +999,9 @@
 KonqPopupMenu::~KonqPopupMenu()
 {
   m_pluginList.clear();
+  m_factory->removeClient(this);
   delete m_factory;
   delete m_builder;
   delete d;
Comment 1 Myriam Schweingruber 2012-06-18 18:22:14 UTC
Message from the Bugsquad and Konqueror teams:
This bug is closed as outdated, as we do not have the manpower to maintain the KDE3 version anymore.
If you still can reproduce this issue with Konqueror 4.8.4 or later, please open a new report.
Thank you for your understanding.