Details
-
Bug
-
Resolution: Fixed
-
Not Evaluated
-
6.2, 6.4.1
-
None
-
iOS
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:
- Create a qml project
- replace main.cpp with the one attached
- run via QtCreator in debug mode on iOS
- quit the application on the iOS device by swiping it up in the task manager
- "qDebug() << "Exiting localEventLoop"; " will never be called