Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-103984

QWindowsDialogHelperBase calls QThread::terminate()

    XMLWordPrintable

    Details

    • Platform/s:
      Windows
    • Commits:
      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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              vhilshei Volker Hilsheimer
              Reporter:
              peppe Giuseppe D'Angelo
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes