From 8176d6b51c743621d5aab0fb52a121017fd4c7a7 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 28 May 2024 18:05:10 +0100 Subject: [PATCH] messageTray: Ensure _updateDatetimeId idle callback is cancelled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Part-of: --- js/ui/messageTray.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index d88ef4223..fc07ab4ec 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -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(); } }