From 30e49cc3ca2c6cea07ace149eb7448f48dbb5d36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 8 Jul 2021 20:36:14 +0200 Subject: [PATCH] iconGrid: Disconnect signals on destroy Otherwise the handler will trip over unset properties on an object that is being disposed. Avoid the resulting log spam by disconnecting the handler in question. Part-of: --- js/ui/iconGrid.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js index cdceb020d..efc638913 100644 --- a/js/ui/iconGrid.js +++ b/js/ui/iconGrid.js @@ -1172,7 +1172,8 @@ var IconGrid = GObject.registerClass({ row_spacing: 0, }); const layoutManager = new IconGridLayout(layoutParams); - layoutManager.connect('pages-changed', () => this.emit('pages-changed')); + const pagesChangedId = layoutManager.connect('pages-changed', + () => this.emit('pages-changed')); super._init({ style_class: 'icon-grid', @@ -1188,6 +1189,7 @@ var IconGrid = GObject.registerClass({ this.connect('actor-added', this._childAdded.bind(this)); this.connect('actor-removed', this._childRemoved.bind(this)); + this.connect('destroy', () => layoutManager.disconnect(pagesChangedId)); } _getChildrenToAnimate() {