From 39526f76651bf7e0082f55301fc64563acee9940 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: (cherry picked from commit 8176d6b51c743621d5aab0fb52a121017fd4c7a7) --- js/ui/messageTray.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 73a9ed9f6..22a93df0b 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -498,6 +498,11 @@ export const Notification = GObject.registerClass({ destroy(reason = NotificationDestroyedReason.DISMISSED) { this.emit('destroy', reason); + + if (this._updateDatetimeId) + GLib.source_remove(this._updateDatetimeId); + delete this._updateDatetimeId; + this.run_dispose(); } });