commit:     957b23ec2630a603c6c00905f21529b9c4bc4653
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Feb  5 22:37:17 2023 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun Feb  5 22:37:17 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=957b23ec

dev-qt/qtcore: Re-add accidentally removed patch

Closes: https://bugs.gentoo.org/893322
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../files/qtcore-5.15.8-fix-crash-w-debug.patch    | 41 ++++++++++++++++++++++
 1 file changed, 41 insertions(+)

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 <sit...@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
+

Reply via email to