From 068424b26532f3551a81421a9be67ed206e5c11a Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 11 Aug 2021 07:02:28 +0100 Subject: gentoo resync : 11.08.2021 --- .../files/krita-4.4.7-pykrita-crash-on-exit.patch | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 media-gfx/krita/files/krita-4.4.7-pykrita-crash-on-exit.patch (limited to 'media-gfx/krita/files/krita-4.4.7-pykrita-crash-on-exit.patch') diff --git a/media-gfx/krita/files/krita-4.4.7-pykrita-crash-on-exit.patch b/media-gfx/krita/files/krita-4.4.7-pykrita-crash-on-exit.patch new file mode 100644 index 000000000000..f896a3920efc --- /dev/null +++ b/media-gfx/krita/files/krita-4.4.7-pykrita-crash-on-exit.patch @@ -0,0 +1,41 @@ +From a0c29913114164ff3f2ba4e255ccee1c52cb3e86 Mon Sep 17 00:00:00 2001 +From: Alvin Wong +Date: Sat, 19 Jun 2021 16:29:45 +0800 +Subject: [PATCH] Fix PyKrita cleanup using qApp::aboutToQuit to prevent crash + +Suspecting that we can't have Python clean up its QObject's inside +QCoreApplication's destructor, but must be done before it. + +BUG: 417465 +--- + plugins/extensions/pykrita/plugin/plugin.cpp | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +diff --git a/plugins/extensions/pykrita/plugin/plugin.cpp b/plugins/extensions/pykrita/plugin/plugin.cpp +index ef0e27eb65..66f552b007 100644 +--- a/plugins/extensions/pykrita/plugin/plugin.cpp ++++ b/plugins/extensions/pykrita/plugin/plugin.cpp +@@ -13,6 +13,8 @@ + #include + #include "pyqtpluginsettings.h" + ++#include ++ + #include + + K_PLUGIN_FACTORY_WITH_JSON(KritaPyQtPluginFactory, "kritapykrita.json", registerPlugin();) +@@ -74,6 +76,12 @@ KritaPyQtPlugin::KritaPyQtPlugin(QObject *parent, const QVariantList &) + Q_FOREACH (Extension *extension, Krita::instance()->extensions()) { + extension->setup(); + } ++ ++ // This ensures that QObject's owned by Python are destructed before ++ // the destructor of QCoreApplication is called, in order to prevent ++ // a crash on exit. ++ // See https://bugs.kde.org/show_bug.cgi?id=417465 ++ connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, this, []() { PyKrita::finalize(); }); + } + + KritaPyQtPlugin::~KritaPyQtPlugin() +-- +GitLab -- cgit v1.2.3