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: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1909>
This commit is contained in:
Florian Müllner 2021-07-08 20:36:14 +02:00 committed by Marge Bot
parent 0e72579364
commit 30e49cc3ca

View File

@ -1172,7 +1172,8 @@ var IconGrid = GObject.registerClass({
row_spacing: 0, row_spacing: 0,
}); });
const layoutManager = new IconGridLayout(layoutParams); 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({ super._init({
style_class: 'icon-grid', style_class: 'icon-grid',
@ -1188,6 +1189,7 @@ var IconGrid = GObject.registerClass({
this.connect('actor-added', this._childAdded.bind(this)); this.connect('actor-added', this._childAdded.bind(this));
this.connect('actor-removed', this._childRemoved.bind(this)); this.connect('actor-removed', this._childRemoved.bind(this));
this.connect('destroy', () => layoutManager.disconnect(pagesChangedId));
} }
_getChildrenToAnimate() { _getChildrenToAnimate() {