QEventLoop: fix potential UB in QBasicAtomic initialization
Until C++17 (inclusive), a default-constructed std::atomic object can, officially, only be initialized with a call to std::atomic_init, for which QBasicAtomic doesn't have API. It is even unclear whether zero-initialization of static and thread-local objects will cause the object to be initialized. To fix, port from QBasicAtomic to QAtomic (which initializes to zero). Task-number: QTBUG-137465 Pick-to: 6.10 6.9 6.8 6.5 Change-Id: I31a95b36506c376ef0817ef3d61bd8ca02371585 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
49db71bb19
commit
8f4ffb72f9
@ -34,8 +34,8 @@ public:
|
|||||||
|
|
||||||
QAtomicInt quitLockRef;
|
QAtomicInt quitLockRef;
|
||||||
|
|
||||||
QBasicAtomicInt exit; // bool
|
QAtomicInt exit; // bool
|
||||||
QBasicAtomicInt returnCode;
|
QAtomicInt returnCode;
|
||||||
bool inExec;
|
bool inExec;
|
||||||
|
|
||||||
void ref()
|
void ref()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user