messageTray: Only destroy policy after emitting ::destroy
Destroying the policy invalidates it, so accessing it from a Source::destroy handler (for example to disconnect signal handlers) currently results in warnings like: Object .Gjs_ui_messageTray_NotificationApplicationPolicy (0x7f8c7c0a64a0), has been already deallocated — impossible to access it. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2238
This commit is contained in:
parent
c89d6a633a
commit
279072795f
@ -880,8 +880,6 @@ var Source = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
destroy(reason) {
|
destroy(reason) {
|
||||||
this.policy.destroy();
|
|
||||||
|
|
||||||
let notifications = this.notifications;
|
let notifications = this.notifications;
|
||||||
this.notifications = [];
|
this.notifications = [];
|
||||||
|
|
||||||
@ -890,6 +888,7 @@ var Source = GObject.registerClass({
|
|||||||
|
|
||||||
this.emit('destroy', reason);
|
this.emit('destroy', reason);
|
||||||
|
|
||||||
|
this.policy.destroy();
|
||||||
this.run_dispose();
|
this.run_dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user