commit:     dfe031ff1801e8aee728ebdcccfa7c3ab7df9368
Author:     Michael Palimaka <kensington <AT> gentoo <DOT> org>
AuthorDate: Tue Feb  9 12:37:42 2016 +0000
Commit:     Michael Palimaka <kensington <AT> gentoo <DOT> org>
CommitDate: Tue Feb  9 12:37:42 2016 +0000
URL:        https://gitweb.gentoo.org/proj/kde.git/commit/?id=dfe031ff

kde-frameworks/kactivities: backport patch from upstream solving crash

Package-Manager: portage-2.2.27

 .../files/kactivities-5.19.0-crash.patch           | 89 ++++++++++++++++++++++
 .../kactivities/kactivities-5.19.0.ebuild          |  2 +
 2 files changed, 91 insertions(+)

diff --git a/kde-frameworks/kactivities/files/kactivities-5.19.0-crash.patch 
b/kde-frameworks/kactivities/files/kactivities-5.19.0-crash.patch
new file mode 100644
index 0000000..001fbb2
--- /dev/null
+++ b/kde-frameworks/kactivities/files/kactivities-5.19.0-crash.patch
@@ -0,0 +1,89 @@
+From b3c8ad1ad48d65ea77724f94073909dc8ab97596 Mon Sep 17 00:00:00 2001
+From: David Edmundson <[email protected]>
+Date: Sat, 6 Feb 2016 18:02:53 +0000
+Subject: [PATCH] Fix crash in activities context menu
+
+Currently we call deleteLater() from inside ::run which is running in a
+different thread than the receiving object.
+(QThread objects live in the thread that created them, not in the thread
+they create)
+
+This patch causes deleteLater to be run in the right thread.
+
+QCoreApplication::postEvent is thread safe but it needs to be in the
+right thread to work out the correct event loop level for deferred
+delete events.
+
+BUG: 351485
+REVIEW: 126955
+---
+ src/workspace/fileitemplugin/FileItemLinkingPlugin.cpp           | 2 +-
+ .../fileitemplugin/FileItemLinkingPluginActionLoader.cpp         | 9 +++++++--
+ src/workspace/fileitemplugin/FileItemLinkingPluginActionLoader.h | 4 ++--
+ 3 files changed, 10 insertions(+), 5 deletions(-)
+
+diff --git a/src/workspace/fileitemplugin/FileItemLinkingPlugin.cpp 
b/src/workspace/fileitemplugin/FileItemLinkingPlugin.cpp
+index a887132..f3f6dde 100644
+--- a/src/workspace/fileitemplugin/FileItemLinkingPlugin.cpp
++++ b/src/workspace/fileitemplugin/FileItemLinkingPlugin.cpp
+@@ -124,7 +124,7 @@ void FileItemLinkingPlugin::Private::loadAllActions()
+         setActions({ action });
+ 
+     } else if (!loaded) {
+-        auto loader = new FileItemLinkingPluginActionLoader(items);
++        auto loader = FileItemLinkingPluginActionLoader::create(items);
+ 
+         static FileItemLinkingPluginActionStaticInit init;
+ 
+diff --git 
a/src/workspace/fileitemplugin/FileItemLinkingPluginActionLoader.cpp 
b/src/workspace/fileitemplugin/FileItemLinkingPluginActionLoader.cpp
+index 3343eb4..b35713d 100644
+--- a/src/workspace/fileitemplugin/FileItemLinkingPluginActionLoader.cpp
++++ b/src/workspace/fileitemplugin/FileItemLinkingPluginActionLoader.cpp
+@@ -40,6 +40,13 @@
+ 
+ #include "common/dbus/common.h"
+ 
++FileItemLinkingPluginActionLoader* 
FileItemLinkingPluginActionLoader::create(const KFileItemListProperties &items)
++{
++    auto l = new FileItemLinkingPluginActionLoader(items);
++    connect(l, &QThread::finished, l, &QObject::deleteLater);
++    return l;
++}
++
+ FileItemLinkingPluginActionLoader::FileItemLinkingPluginActionLoader(
+     const KFileItemListProperties &items)
+     : items(items)
+@@ -150,8 +157,6 @@ void FileItemLinkingPluginActionLoader::run()
+     }
+ 
+     emit result(actions);
+-
+-    deleteLater();
+ }
+ 
+ Action
+diff --git a/src/workspace/fileitemplugin/FileItemLinkingPluginActionLoader.h 
b/src/workspace/fileitemplugin/FileItemLinkingPluginActionLoader.h
+index 50dccc5..5264a45 100644
+--- a/src/workspace/fileitemplugin/FileItemLinkingPluginActionLoader.h
++++ b/src/workspace/fileitemplugin/FileItemLinkingPluginActionLoader.h
+@@ -33,8 +33,7 @@ class FileItemLinkingPluginActionLoader: public QThread {
+     Q_OBJECT
+ 
+ public:
+-    FileItemLinkingPluginActionLoader(const KFileItemListProperties &items);
+-
++    static FileItemLinkingPluginActionLoader* create(const 
KFileItemListProperties &items);
+     void run() Q_DECL_OVERRIDE;
+ 
+     Action createAction(const QString &activity, bool link,
+@@ -46,6 +45,7 @@ Q_SIGNALS:
+     void result(const ActionList &actions);
+ 
+ private:
++    FileItemLinkingPluginActionLoader(const KFileItemListProperties &items);
+     KFileItemListProperties items;
+     KActivities::Consumer activities;
+ };
+-- 
+2.4.10
+

diff --git a/kde-frameworks/kactivities/kactivities-5.19.0.ebuild 
b/kde-frameworks/kactivities/kactivities-5.19.0.ebuild
index d76f2c1..a9f488b 100644
--- a/kde-frameworks/kactivities/kactivities-5.19.0.ebuild
+++ b/kde-frameworks/kactivities/kactivities-5.19.0.ebuild
@@ -35,3 +35,5 @@ RDEPEND="
 DEPEND="${RDEPEND}
        >=dev-libs/boost-1.54
 "
+
+PATCHES=( "${FILESDIR}/${P}-crash.patch" )

Reply via email to