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

Bug #1448079 reported by Chris Coulson
32
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Oxide
Fix Released
Medium
Chris Coulson
1.18
Fix Released
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
Revision history for this message
Olivier Tilloy (osomon) wrote :

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

Revision history for this message
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
Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.