summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2023-02-05 23:37:17 +0100
committerAndreas Sturmlechner <asturm@gentoo.org>2023-02-05 23:37:17 +0100
commit957b23ec2630a603c6c00905f21529b9c4bc4653 (patch)
tree5b2b0374480651ba438a287208bd7ac12e95b7d0
parentsys-kernel/git-sources: add 6.2_rc7 (diff)
downloadgentoo-957b23ec.tar.gz
gentoo-957b23ec.tar.bz2
gentoo-957b23ec.zip
dev-qt/qtcore: Re-add accidentally removed patch
Closes: https://bugs.gentoo.org/893322 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
-rw-r--r--dev-qt/qtcore/files/qtcore-5.15.8-fix-crash-w-debug.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/dev-qt/qtcore/files/qtcore-5.15.8-fix-crash-w-debug.patch b/dev-qt/qtcore/files/qtcore-5.15.8-fix-crash-w-debug.patch
new file mode 100644
index 000000000000..74f5ed5c4886
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-5.15.8-fix-crash-w-debug.patch
@@ -0,0 +1,41 @@
+From 0c0b34badb8a56f5c0d7d43c3847508774c8e553 Mon Sep 17 00:00:00 2001
+From: Harald Sitter <sitter@kde.org>
+Date: Mon, 2 Jan 2023 12:38:02 +0100
+Subject: [PATCH] correctly set up ref counting in
+ QThreadPool::tryStart(std::function)
+
+this function was inconsistent with the QThreadPool::tryStart(QRunnable)
+overload, where ref counting does get set up correctly. the lack of ref
+counting setup would later cause trouble because we assert the ref
+counting state all over QThreadPool. to prevent failed assertions we
+correctly set up ref counting now.
+
+this change is not applicable to Qt6 because the ref counting has
+already been removed there:
+https://github.com/qt/qtbase/commit/ecfda98d1f91c6a7da0d89826558d856cd88e670
+
+BUG: 449688
+---
+ src/corelib/thread/qthreadpool.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/corelib/thread/qthreadpool.cpp b/src/corelib/thread/qthreadpool.cpp
+index 40cc646519..8aa06a4c8f 100644
+--- a/src/corelib/thread/qthreadpool.cpp
++++ b/src/corelib/thread/qthreadpool.cpp
+@@ -602,8 +602,12 @@ bool QThreadPool::tryStart(std::function<void()> functionToRun)
+ return false;
+
+ QRunnable *runnable = QRunnable::create(std::move(functionToRun));
++ Q_ASSERT(runnable->ref == 0);
++ ++runnable->ref;
+ if (d->tryStart(runnable))
+ return true;
++ --runnable->ref;
++ Q_ASSERT(runnable->ref == 0);
+ delete runnable;
+ return false;
+ }
+--
+GitLab
+