[gnome-shell] messageTray: Only destroy policy after emitting ::destroy



commit 279072795f9910ba335e5c3329be55d15ee9fa58
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Mar 25 23:49:58 2020 +0100

    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

 js/ui/messageTray.js | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index 6f03968e9e..f949345be5 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -880,8 +880,6 @@ var Source = GObject.registerClass({
     }
 
     destroy(reason) {
-        this.policy.destroy();
-
         let notifications = this.notifications;
         this.notifications = [];
 
@@ -890,6 +888,7 @@ var Source = GObject.registerClass({
 
         this.emit('destroy', reason);
 
+        this.policy.destroy();
         this.run_dispose();
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]