messageTray: Ensure _updateDatetimeId idle callback is cancelled
If the idle callback is not explicitly removed when the notification is destroyed, it may be invoked after destruction, and try to modify the notification after it’s been freed. Signed-off-by: Philip Withnall <pwithnall@gnome.org> Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3352>
This commit is contained in:
parent
37e49e8a22
commit
8176d6b51c
@ -475,6 +475,11 @@ export class Notification extends GObject.Object {
|
||||
|
||||
destroy(reason = NotificationDestroyedReason.DISMISSED) {
|
||||
this.emit('destroy', reason);
|
||||
|
||||
if (this._updateDatetimeId)
|
||||
GLib.source_remove(this._updateDatetimeId);
|
||||
delete this._updateDatetimeId;
|
||||
|
||||
this.run_dispose();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user