Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.12.0
-
Desktop
-
-
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.