-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.8.4, 6.10.0
The commit is:
https://codereview.qt-project.org/c/qt/qtbase/+/627786
It replaces some if conditions using "QThread::isMainThread()". But under corner case, this causes crash.
Minimal reproducer:
#include <QApplication> #include <QThread> int main(int argc, char** argv) { std::thread([&]() { QApplication app(argc, argv); }).join(); QApplication app(argc, argv); }
The first QApplication in another thread is totally fine. But after that, during the initialization of the second QApplication, QThread gets confused:
!QThread::isMainThread()
is somehow considered true, and if statement reaches
&& !QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedPixmaps)) {
And it crashes there due to "platformIntegration()" returning nullptr;