[gnome-shell] calendar: Use connectObject on _sectionList



commit 4f3b1c51cfbacd4e3b38f832dc30d3fbe29f9aa3
Author: Daniel van Vugt <daniel van vugt canonical com>
Date:   Wed Aug 17 16:26:28 2022 +0800

    calendar: Use connectObject on _sectionList
    
    This prevents _sync() being called after actor destruction (since actor
    destruction became more reliable in mutter@3d94c7cc2) and so eliminates
    this shutdown error:
    
    ```
    (gnome-shell:35197): Gjs-CRITICAL **: 16:31:02.769: Object .Gjs_ui_calendar_Placeholder (0x559ed6e547e0), 
has been already disposed — impossible to set any property on it. This might be caused by the object having 
been destroyed from C code using something such as destroy(), dispose(), or remove() vfuncs.
    == Stack trace for context 0x559ed6022310 ==
     #0   559ed783c5a8 i   resource:///org/gnome/shell/ui/calendar.js:1012 (31955be5fc90 @ 148)
     #1   7ffef8f38230 b   self-hosted:1178 (32af8f6b0c40 @ 454)
     #2   559ed783c518 i   resource:///org/gnome/shell/ui/popupMenu.js:806 (31955be18ce0 @ 52)
     #3   559ed783c488 i   resource:///org/gnome/shell/ui/popupMenu.js:954 (31955be190b0 @ 168)
     #4   559ed783c3f8 i   resource:///org/gnome/shell/ui/panelMenu.js:189 (31955be88150 @ 41)
     #5   7ffef8f3de60 b   self-hosted:1178 (32af8f6b0c40 @ 423)
    ```
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2429>

 js/ui/calendar.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/calendar.js b/js/ui/calendar.js
index 9981a456f6..90ef9cc959 100644
--- a/js/ui/calendar.js
+++ b/js/ui/calendar.js
@@ -976,8 +976,10 @@ class CalendarMessageList extends St.Widget {
             y_expand: true,
             y_align: Clutter.ActorAlign.START,
         });
-        this._sectionList.connect('actor-added', this._sync.bind(this));
-        this._sectionList.connect('actor-removed', this._sync.bind(this));
+        this._sectionList.connectObject(
+            'actor-added', this._sync.bind(this),
+            'actor-removed', this._sync.bind(this),
+            this);
         this._scrollView.add_actor(this._sectionList);
 
         this._mediaSection = new Mpris.MediaSection();


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