commit:     5ee12cc942812f6368b3824a6aa2174a17eb338f
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Wed May 31 19:39:48 2017 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed May 31 20:21:28 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5ee12cc9

kde-frameworks/kdeclarative: Fix plasmashell/taskman memleak

See also: https://bugs.kde.org/show_bug.cgi?id=380270

Package-Manager: Portage-2.3.5, Repoman-2.3.1

 .../files/kdeclarative-5.34.0-memleak.patch        | 73 ++++++++++++++++++++++
 .../kdeclarative/kdeclarative-5.34.0-r1.ebuild     | 34 ++++++++++
 2 files changed, 107 insertions(+)

diff --git 
a/kde-frameworks/kdeclarative/files/kdeclarative-5.34.0-memleak.patch 
b/kde-frameworks/kdeclarative/files/kdeclarative-5.34.0-memleak.patch
new file mode 100644
index 00000000000..43fdb8a4bf6
--- /dev/null
+++ b/kde-frameworks/kdeclarative/files/kdeclarative-5.34.0-memleak.patch
@@ -0,0 +1,73 @@
+From 695f24fb522a5ae6fe2530cbd72d3966b234b025 Mon Sep 17 00:00:00 2001
+From: David Edmundson <k...@davidedmundson.co.uk>
+Date: Wed, 31 May 2017 10:08:25 +0100
+Subject: [PATCH] Don't leak MimeData object
+
+Summary:
+A DeclarativeDropArea creates a new DeclarativeDragDropEvent on every
+enter/move/leave event.
+
+The getter method for the mimeData property creates a new MimeData
+QObject wrapper, which then leaks.
+
+Use of the mimeData object outside of the event shouldn't be expected to
+work, and a quick grep couldn't find any usage.
+
+BUG: 380270
+
+Test Plan: Dragged some things
+
+Reviewers: #plasma, mart, hein
+
+Reviewed By: #plasma, mart, hein
+
+Subscribers: hein, plasma-devel, #frameworks
+
+Tags: #plasma, #frameworks
+
+Differential Revision: https://phabricator.kde.org/D6017
+---
+ src/qmlcontrols/draganddrop/DeclarativeDragDropEvent.cpp | 4 ++--
+ src/qmlcontrols/draganddrop/DeclarativeDragDropEvent.h   | 5 ++---
+ 2 files changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/src/qmlcontrols/draganddrop/DeclarativeDragDropEvent.cpp 
b/src/qmlcontrols/draganddrop/DeclarativeDragDropEvent.cpp
+index 5c1b0e3..a75f85f 100644
+--- a/src/qmlcontrols/draganddrop/DeclarativeDragDropEvent.cpp
++++ b/src/qmlcontrols/draganddrop/DeclarativeDragDropEvent.cpp
+@@ -65,7 +65,7 @@ DeclarativeMimeData* DeclarativeDragDropEvent::mimeData()
+     if (!m_data && m_event) {
+ //         TODO This should be using MimeDataWrapper eventually, although 
this is an API break,
+ //         so will need to be done carefully.
+-        m_data = new DeclarativeMimeData(m_event->mimeData());
++        m_data.reset(new DeclarativeMimeData(m_event->mimeData()));
+     }
+-    return m_data;
++    return m_data.data();
+ }
+diff --git a/src/qmlcontrols/draganddrop/DeclarativeDragDropEvent.h 
b/src/qmlcontrols/draganddrop/DeclarativeDragDropEvent.h
+index 3fd846d..b35568a 100644
+--- a/src/qmlcontrols/draganddrop/DeclarativeDragDropEvent.h
++++ b/src/qmlcontrols/draganddrop/DeclarativeDragDropEvent.h
+@@ -26,8 +26,7 @@
+ 
+ #include <QObject>
+ #include "DeclarativeDropArea.h"
+-
+-class DeclarativeMimeData;
++#include "DeclarativeMimeData.h"
+ 
+ class DeclarativeDragDropEvent : public QObject
+ {
+@@ -115,7 +114,7 @@ private:
+     int m_y;
+     Qt::MouseButtons m_buttons;
+     Qt::KeyboardModifiers m_modifiers;
+-    DeclarativeMimeData* m_data;
++    QScopedPointer<DeclarativeMimeData> m_data;
+     QDropEvent* m_event;
+ };
+ 
+-- 
+2.13.0
+

diff --git a/kde-frameworks/kdeclarative/kdeclarative-5.34.0-r1.ebuild 
b/kde-frameworks/kdeclarative/kdeclarative-5.34.0-r1.ebuild
new file mode 100644
index 00000000000..da3138effd9
--- /dev/null
+++ b/kde-frameworks/kdeclarative/kdeclarative-5.34.0-r1.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+KDE_TEST="false"
+inherit kde5
+
+DESCRIPTION="Framework providing integration of QML and KDE work spaces"
+LICENSE="LGPL-2+"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE=""
+
+# drop qtdeclarative subslot operator when QT_MINIMAL >= 5.8.0
+DEPEND="
+       $(add_frameworks_dep kconfig)
+       $(add_frameworks_dep kcoreaddons)
+       $(add_frameworks_dep kglobalaccel)
+       $(add_frameworks_dep ki18n)
+       $(add_frameworks_dep kiconthemes)
+       $(add_frameworks_dep kio)
+       $(add_frameworks_dep kpackage)
+       $(add_frameworks_dep kservice)
+       $(add_frameworks_dep kwidgetsaddons)
+       $(add_frameworks_dep kwindowsystem)
+       $(add_qt_dep qtdeclarative '' '' '5=')
+       $(add_qt_dep qtgui)
+       $(add_qt_dep qtnetwork)
+       $(add_qt_dep qtwidgets)
+       media-libs/libepoxy
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=( "${FILESDIR}/${P}-memleak.patch" )

Reply via email to