[gnome-shell-extensions] window-list: Explicitly dispose settings on destroy



commit cc72a34973bf9441b976a531679e5e74e12aeb0a
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Sep 30 18:16:16 2022 +0200

    window-list: Explicitly dispose settings on destroy
    
    This will not only disconnect the signal handler, but also remove
    any bindings. This works around a crash that happens if a setting
    that triggers the binding changes at the same time as a setting
    that rebuilds the window list; in that case, the binding handler
    runs after gjs has dropped its wrapper object, but before the
    binding is removed automaticalled when the object is finalized.
    
    https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/416
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/243>

 extensions/window-list/extension.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js
index 1d71d34..1f4a22f 100644
--- a/extensions/window-list/extension.js
+++ b/extensions/window-list/extension.js
@@ -860,8 +860,8 @@ class WindowList extends St.Widget {
         this._dndWindow = null;
 
         this._settings = ExtensionUtils.getSettings();
-        this._groupingModeChangedId = this._settings.connect(
-            'changed::grouping-mode', this._groupingModeChanged.bind(this));
+        this._settings.connect('changed::grouping-mode',
+            () => this._groupingModeChanged());
         this._grouped = undefined;
         this._groupingModeChanged();
     }
@@ -1130,7 +1130,7 @@ class WindowList extends St.Widget {
         Main.xdndHandler.disconnect(this._dragBeginId);
         Main.xdndHandler.disconnect(this._dragEndId);
 
-        this._settings.disconnect(this._groupingModeChangedId);
+        this._settings.run_dispose();
 
         let windows = global.get_window_actors();
         for (let i = 0; i < windows.length; i++)


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