workspace: Fix a signal leak in WorkspaceBackground

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2143>
This commit is contained in:
Daniel van Vugt 2022-01-21 18:47:09 +08:00 committed by Marge Bot
parent 9b70f5902c
commit ed7fe756ef

View File

@ -939,7 +939,7 @@ class WorkspaceBackground extends St.Widget {
this._workarea = Main.layoutManager.getWorkAreaForMonitor(monitorIndex); this._workarea = Main.layoutManager.getWorkAreaForMonitor(monitorIndex);
this._stateAdjustment = stateAdjustment; this._stateAdjustment = stateAdjustment;
stateAdjustment.connect('notify::value', () => { this._adjustmentId = stateAdjustment.connect('notify::value', () => {
this._updateBorderRadius(); this._updateBorderRadius();
this.queue_relayout(); this.queue_relayout();
}); });
@ -1054,6 +1054,11 @@ class WorkspaceBackground extends St.Widget {
global.display.disconnect(this._workareasChangedId); global.display.disconnect(this._workareasChangedId);
delete this._workareasChangedId; delete this._workareasChangedId;
} }
if (this._adjustmentId) {
this._stateAdjustment.disconnect(this._adjustmentId);
delete this._adjustmentId;
}
} }
}); });