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

A nested QEventLoop does not exit if processEvents intermixed.

    XMLWordPrintable

Details

    • macOS
    • 30e32870a052fda1a23099e46864242e52d94a17 (qt/qtbase/5.15)

    Description

      In some situation application stuck in a QEventLoop after exit() is called on the event loop.

      This can be reproduced with a simple Qt application attached on 5.12 , very same example works on windows. The application creates a QEventLoop which has exit called in an event posted to the main thread. However, due to the fact that this event ends up being processed in an explicit call to processEvents it appears to never interrupt the outer QEventLoop which had exit() called on it.

      After looking into QCocoaEventDispacher::processEvents and QEventDispatcherWin32::processEvents It looks like on windows interrupts propagate up to parent event loops which will cause them to all check whether or not they should terminate. However, this is not the case on mac since the inner event loop will restore the interrupt flag back to false when the QBoolBlocker goes out of scope. This then leaves the QEventLoop on mac in a state where it has it's exit flag set but it has not been interrupted.

      Attachments

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

        Activity

          People

            tpochep Timur Pocheptsov
            irfan.omair@digia.com Irfan Omair
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes