Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
6.4
-
None
-
-
c450285c41 (qt/qtbase/dev) c450285c41 (qt/tqtc-qtbase/6.4)
Description
In qwindowsdialoghelpers.cpp there's:
template <class BaseClass> void QWindowsDialogHelperBase<BaseClass>::cleanupThread() { if (m_thread) { // Thread may be running if the dialog failed to close. if (m_thread->isRunning()) m_thread->wait(500); if (m_thread->isRunning()) { m_thread->terminate(); m_thread->wait(300); if (m_thread->isRunning()) qCCritical(lcQpaDialogs) <<__FUNCTION__ << "Failed to terminate thread."; else qCWarning(lcQpaDialogs) << __FUNCTION__ << "Thread terminated."; } delete m_thread; m_thread = nullptr; } }
Calling QThread::terminate() is always an error and we must not do it from within Qt. (Example: if the other thread gets terminated while keeping a memory allocator lock, now you cannot (de)allocate memory in your application.)
Attachments
Issue Links
- relates to
-
QTBUG-103922 Calling QThread::terminate() in destructor causes double object destruction
- Closed
-
QTBUG-93298 Windows: Application hangs (or crashes) on quit while QtQuick FileDialog is open
- Closed