Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: kde-frameworks/kdeclarative/files/, kde-frameworks/kdeclarative/
Date: Wed, 31 May 2017 20:21:43
Message-Id: 1496262088.5ee12cc942812f6368b3824a6aa2174a17eb338f.asturm@gentoo
1 commit: 5ee12cc942812f6368b3824a6aa2174a17eb338f
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Wed May 31 19:39:48 2017 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Wed May 31 20:21:28 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5ee12cc9
7
8 kde-frameworks/kdeclarative: Fix plasmashell/taskman memleak
9
10 See also: https://bugs.kde.org/show_bug.cgi?id=380270
11
12 Package-Manager: Portage-2.3.5, Repoman-2.3.1
13
14 .../files/kdeclarative-5.34.0-memleak.patch | 73 ++++++++++++++++++++++
15 .../kdeclarative/kdeclarative-5.34.0-r1.ebuild | 34 ++++++++++
16 2 files changed, 107 insertions(+)
17
18 diff --git a/kde-frameworks/kdeclarative/files/kdeclarative-5.34.0-memleak.patch b/kde-frameworks/kdeclarative/files/kdeclarative-5.34.0-memleak.patch
19 new file mode 100644
20 index 00000000000..43fdb8a4bf6
21 --- /dev/null
22 +++ b/kde-frameworks/kdeclarative/files/kdeclarative-5.34.0-memleak.patch
23 @@ -0,0 +1,73 @@
24 +From 695f24fb522a5ae6fe2530cbd72d3966b234b025 Mon Sep 17 00:00:00 2001
25 +From: David Edmundson <kde@×××××××××××××××××.uk>
26 +Date: Wed, 31 May 2017 10:08:25 +0100
27 +Subject: [PATCH] Don't leak MimeData object
28 +
29 +Summary:
30 +A DeclarativeDropArea creates a new DeclarativeDragDropEvent on every
31 +enter/move/leave event.
32 +
33 +The getter method for the mimeData property creates a new MimeData
34 +QObject wrapper, which then leaks.
35 +
36 +Use of the mimeData object outside of the event shouldn't be expected to
37 +work, and a quick grep couldn't find any usage.
38 +
39 +BUG: 380270
40 +
41 +Test Plan: Dragged some things
42 +
43 +Reviewers: #plasma, mart, hein
44 +
45 +Reviewed By: #plasma, mart, hein
46 +
47 +Subscribers: hein, plasma-devel, #frameworks
48 +
49 +Tags: #plasma, #frameworks
50 +
51 +Differential Revision: https://phabricator.kde.org/D6017
52 +---
53 + src/qmlcontrols/draganddrop/DeclarativeDragDropEvent.cpp | 4 ++--
54 + src/qmlcontrols/draganddrop/DeclarativeDragDropEvent.h | 5 ++---
55 + 2 files changed, 4 insertions(+), 5 deletions(-)
56 +
57 +diff --git a/src/qmlcontrols/draganddrop/DeclarativeDragDropEvent.cpp b/src/qmlcontrols/draganddrop/DeclarativeDragDropEvent.cpp
58 +index 5c1b0e3..a75f85f 100644
59 +--- a/src/qmlcontrols/draganddrop/DeclarativeDragDropEvent.cpp
60 ++++ b/src/qmlcontrols/draganddrop/DeclarativeDragDropEvent.cpp
61 +@@ -65,7 +65,7 @@ DeclarativeMimeData* DeclarativeDragDropEvent::mimeData()
62 + if (!m_data && m_event) {
63 + // TODO This should be using MimeDataWrapper eventually, although this is an API break,
64 + // so will need to be done carefully.
65 +- m_data = new DeclarativeMimeData(m_event->mimeData());
66 ++ m_data.reset(new DeclarativeMimeData(m_event->mimeData()));
67 + }
68 +- return m_data;
69 ++ return m_data.data();
70 + }
71 +diff --git a/src/qmlcontrols/draganddrop/DeclarativeDragDropEvent.h b/src/qmlcontrols/draganddrop/DeclarativeDragDropEvent.h
72 +index 3fd846d..b35568a 100644
73 +--- a/src/qmlcontrols/draganddrop/DeclarativeDragDropEvent.h
74 ++++ b/src/qmlcontrols/draganddrop/DeclarativeDragDropEvent.h
75 +@@ -26,8 +26,7 @@
76 +
77 + #include <QObject>
78 + #include "DeclarativeDropArea.h"
79 +-
80 +-class DeclarativeMimeData;
81 ++#include "DeclarativeMimeData.h"
82 +
83 + class DeclarativeDragDropEvent : public QObject
84 + {
85 +@@ -115,7 +114,7 @@ private:
86 + int m_y;
87 + Qt::MouseButtons m_buttons;
88 + Qt::KeyboardModifiers m_modifiers;
89 +- DeclarativeMimeData* m_data;
90 ++ QScopedPointer<DeclarativeMimeData> m_data;
91 + QDropEvent* m_event;
92 + };
93 +
94 +--
95 +2.13.0
96 +
97
98 diff --git a/kde-frameworks/kdeclarative/kdeclarative-5.34.0-r1.ebuild b/kde-frameworks/kdeclarative/kdeclarative-5.34.0-r1.ebuild
99 new file mode 100644
100 index 00000000000..da3138effd9
101 --- /dev/null
102 +++ b/kde-frameworks/kdeclarative/kdeclarative-5.34.0-r1.ebuild
103 @@ -0,0 +1,34 @@
104 +# Copyright 1999-2017 Gentoo Foundation
105 +# Distributed under the terms of the GNU General Public License v2
106 +
107 +EAPI=6
108 +
109 +KDE_TEST="false"
110 +inherit kde5
111 +
112 +DESCRIPTION="Framework providing integration of QML and KDE work spaces"
113 +LICENSE="LGPL-2+"
114 +KEYWORDS="~amd64 ~arm ~x86"
115 +IUSE=""
116 +
117 +# drop qtdeclarative subslot operator when QT_MINIMAL >= 5.8.0
118 +DEPEND="
119 + $(add_frameworks_dep kconfig)
120 + $(add_frameworks_dep kcoreaddons)
121 + $(add_frameworks_dep kglobalaccel)
122 + $(add_frameworks_dep ki18n)
123 + $(add_frameworks_dep kiconthemes)
124 + $(add_frameworks_dep kio)
125 + $(add_frameworks_dep kpackage)
126 + $(add_frameworks_dep kservice)
127 + $(add_frameworks_dep kwidgetsaddons)
128 + $(add_frameworks_dep kwindowsystem)
129 + $(add_qt_dep qtdeclarative '' '' '5=')
130 + $(add_qt_dep qtgui)
131 + $(add_qt_dep qtnetwork)
132 + $(add_qt_dep qtwidgets)
133 + media-libs/libepoxy
134 +"
135 +RDEPEND="${DEPEND}"
136 +
137 +PATCHES=( "${FILESDIR}/${P}-memleak.patch" )