Don't run the event loop after QGuiApplication begins to tear down

Bug #1448079 reported by Chris Coulson on 2015-04-24
32
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Oxide
Medium
Chris Coulson
1.18
Medium
Chris Coulson

Bug Description

When initializing Oxide, we register a callback with qAddPostRoutine to run shutdown tasks. As part of this, we spin the event loop whilst waiting for pending unload handlers to finish (unload handlers run after a WebView is destroyed, so there's no way for an application to delay quitting for this).

The QApplication destructor runs these callbacks before it does anything else, which is great for applications that use it. However, the QGuiApplication destructor doesn't attempt to run them at all. This means that for applications using QGuiApplication, the shutdown callback won't execute until the QCoreApplication destructor begins (and QGuiApplication has been torn down).

This is bad, because we could run tasks that call in to QGuiApplication for things that have already gone (eg, QGuiApplication::clipboard(), which would construct a new QClipboard and then leak).

We need to find another way of doing this....

Changed in oxide:
importance: Undecided → Medium
status: New → Triaged
Olivier Tilloy (osomon) wrote :

I wonder if that could explain bug #1435465 ? (although webbrowser-app and webapp-container inherit QApplication, not QGuiApplication)

Chris Coulson (chrisccoulson) wrote :
Changed in oxide:
milestone: none → branch-1.19
assignee: nobody → Chris Coulson (chrisccoulson)
status: Triaged → In Progress
status: In Progress → Fix Released
Chris Coulson (chrisccoulson) wrote :

Targetting at 1.18 as it's a pre-requisite for another change that needs to be backported.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers