[gnome-shell/gnome-40] workspace: Fix a signal leak in WorkspaceBackground



commit 67d1e87db01bd6e619dd44e020ac18caa17297c8
Author: Daniel van Vugt <daniel van vugt canonical com>
Date:   Fri Jan 21 18:47:09 2022 +0800

    workspace: Fix a signal leak in WorkspaceBackground
    
    (cherry picked from commit ed7fe756ef41a4c6ba8515ad06d3cc166594898c)
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2181>

 js/ui/workspace.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index 6c32f01da9..1ad403f9f8 100644
--- a/js/ui/workspace.js
+++ b/js/ui/workspace.js
@@ -939,7 +939,7 @@ class WorkspaceBackground extends St.Widget {
         this._workarea = Main.layoutManager.getWorkAreaForMonitor(monitorIndex);
 
         this._stateAdjustment = stateAdjustment;
-        stateAdjustment.connect('notify::value', () => {
+        this._adjustmentId = stateAdjustment.connect('notify::value', () => {
             this._updateBorderRadius();
             this.queue_relayout();
         });
@@ -1054,6 +1054,11 @@ class WorkspaceBackground extends St.Widget {
             global.display.disconnect(this._workareasChangedId);
             delete this._workareasChangedId;
         }
+
+        if (this._adjustmentId) {
+            this._stateAdjustment.disconnect(this._adjustmentId);
+            delete this._adjustmentId;
+        }
     }
 });
 


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