summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2020-02-09 21:20:41 +0100
committerAndreas Sturmlechner <asturm@gentoo.org>2020-02-09 23:27:51 +0100
commit8dba7f7eba3b961468d2477f4e35da63419298f9 (patch)
treef61a16c9bf7bf3fad8744d2a9fa334161c0af96f /kde-frameworks/kio/files
parentdev-ml/camlp4: restricted ocaml versions in deps (diff)
downloadgentoo-8dba7f7eba3b961468d2477f4e35da63419298f9.tar.gz
gentoo-8dba7f7eba3b961468d2477f4e35da63419298f9.tar.bz2
gentoo-8dba7f7eba3b961468d2477f4e35da63419298f9.zip
kde-frameworks/kio: Fix memory leak in KUrlNavigatorPlacesSelector
Reported-by: David Korth <gerbilsoft@gerbilsoft.com> Closes: https://bugs.gentoo.org/708876 Package-Manager: Portage-2.3.88, Repoman-2.3.20 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'kde-frameworks/kio/files')
-rw-r--r--kde-frameworks/kio/files/kio-5.67.0-memleak.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/kde-frameworks/kio/files/kio-5.67.0-memleak.patch b/kde-frameworks/kio/files/kio-5.67.0-memleak.patch
new file mode 100644
index 00000000000..cf168b79183
--- /dev/null
+++ b/kde-frameworks/kio/files/kio-5.67.0-memleak.patch
@@ -0,0 +1,43 @@
+From 213ed50634c02d8ec4aa91f0c307cfdd6f78170d Mon Sep 17 00:00:00 2001
+From: Fabian Vogt <fabian@ritter-vogt.de>
+Date: Wed, 29 Jan 2020 19:50:33 +0100
+Subject: Fix memory leak in KUrlNavigatorPlacesSelector::updateMenu
+
+Summary:
+This method gets called each time solid notices a change, which can in some
+setups be very frequent. It leaked memory as the submenus and their actions
+were not deallocated properly.
+
+Test Plan: Builds. User feedback: "so far so good, 160 MB Memory usage". It was ~7GiB before this patch.
+
+Reviewers: #frameworks, davidedmundson, meven
+
+Reviewed By: davidedmundson, meven
+
+Subscribers: anthonyfieroni, meven, kde-frameworks-devel
+
+Tags: #frameworks
+
+Differential Revision: https://phabricator.kde.org/D27002
+---
+ src/filewidgets/kurlnavigatorplacesselector.cpp | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/filewidgets/kurlnavigatorplacesselector.cpp b/src/filewidgets/kurlnavigatorplacesselector.cpp
+index 7d33930..103a5fc 100644
+--- a/src/filewidgets/kurlnavigatorplacesselector.cpp
++++ b/src/filewidgets/kurlnavigatorplacesselector.cpp
+@@ -71,6 +71,11 @@ void KUrlNavigatorPlacesSelector::updateMenu()
+ {
+ m_placesMenu->clear();
+
++ // Submenus have to be deleted explicitly (QTBUG-11070)
++ for(QObject *obj : QObjectList(m_placesMenu->children())) {
++ delete qobject_cast<QMenu*>(obj); // Noop for nullptr
++ }
++
+ updateSelection(m_selectedUrl);
+
+ QString previousGroup;
+--
+cgit v1.1