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

local QEventLoop not working during QGuiApplication::aboutToQuit() on iOS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • 6.5
    • 6.2, 6.4.1
    • Core: Event loop
    • None
    • iOS
    • iOS/tvOS/watchOS

    Description

      When the user manually quits an iOS application by swiping it up in the iOS "Task Manager" the only signal to hook in is "QGuiApplication::aboutToQuit()".

      Unfortunately, when this signal is called, the whole Event system for the main thread has already stopped working without any possibility to reactivate.

      Eg:

      • Calling QEventLoop::exec() on a local event loop would simply return immediately with a return code != 0
      • Also QGuiApplication::processEvents() would have no effect in this state!

      This is a huge pitfall since on android, windows and macOS local event loops work fine in this scenario.

       

      Processing Local event loops in exit-cleanup code is an essential feature. Eg: For handling cleanup of background threads which invoke functions in the main thread via "BlockingQueuedConnection".

       

      How to reproduce:

      1. Create a qml project
      2. replace main.cpp with the one attached
      3. run via QtCreator in debug mode on iOS
      4. quit the application on the iOS device by swiping it up in the task manager
      5. "qDebug() << "Exiting localEventLoop"; " will never be called

       

       

       

       

       

      Attachments

        Activity

          People

            vestbo Tor Arne Vestbø
            jowo Josef Wöss
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: