From 2f319c889d9b88b841525e613459fa3b4ea4a6f1 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Thu, 11 Jul 2024 11:22:18 +0200 Subject: [PATCH] QThread: initialize interruptionRequested atomic Coverity complains correctly that the variable is not initialized. std::atomic's default constructor doesn't do it, and we only do it in QThread::start and QThread::finished. So initialize it using NSMDI. Pick-to: 6.7 6.5 Coverity-Id: 466429 Change-Id: I36d4624d46718f50e10bec17ef5e437c60541fa9 Reviewed-by: Thiago Macieira (cherry picked from commit d1f6d2258809ed7e2d7aa50de3b6d6f472cf1bd8) Reviewed-by: Volker Hilsheimer --- src/corelib/thread/qthread_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h index d6fd99e5ba2..4918fd7b852 100644 --- a/src/corelib/thread/qthread_p.h +++ b/src/corelib/thread/qthread_p.h @@ -187,7 +187,7 @@ public: bool running; bool finished; bool isInFinish; //when in QThreadPrivate::finish - std::atomic interruptionRequested; + std::atomic interruptionRequested = false; bool exited; int returnCode;