background: Do not queue idle when cancelled

A cancelled cancellable means that the background was destroyed,
so we shouldn't queue an idle or emit the 'loaded' signal anymore.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5337

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2268>
This commit is contained in:
Florian Müllner 2022-04-13 20:51:55 +02:00 committed by Marge Bot
parent dd28832dcd
commit ef74f922d6

View File

@ -333,6 +333,8 @@ var Background = GObject.registerClass({
return; return;
this.isLoaded = true; this.isLoaded = true;
if (this._cancellable?.is_cancelled())
return;
let id = GLib.idle_add(GLib.PRIORITY_DEFAULT, () => { let id = GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
this.emit('loaded'); this.emit('loaded');