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

CLONE - Memory leak when QEventLoop is used with an adopted native thread - fix for symbian

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 4.8.0
    • 4.8.0
    • Core: Threads
    • None
    • Found on Symbian while testing native thread support. Confirmed to also be a problem on Windows.
    • 6f1efe75dac53377b92d779818b43a34add92f02

      If you create a QEventLoop within an adopted native thread, the QThreadData, QEventDispatcher and associated objects will not be deleted on thread exit and will leak.

      These conditions occur in the tst_qthread autotest, in the adoptedThreadExec() step.

      The issue seems to be that all QObjects in a thread have a ref on the QThreadData. If these refs are not cleared at thread exit, the QThreadData will never be deleted. In this case, QEventLoop is causing a QEventDispatcher to be created, which normally QThread would clean up on exit. But since the QEventDispatcher exists and refs the QThreadData, the QThread never cleans up so the objects exist forever.

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

            mread Murray Read
            mread Murray Read
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes