workspacesDisplay: Disconnect MetaLater and parent signals on destroy
When the WorkspacesDisplay actor is destroyed we should remove the ongoing later and parent widget connections to avoid accessing an invalid object on callback. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/700
This commit is contained in:
parent
24d3744cb9
commit
8656102182
@ -524,6 +524,22 @@ var WorkspacesDisplay = class {
|
|||||||
this._keyPressEventId = 0;
|
this._keyPressEventId = 0;
|
||||||
|
|
||||||
this._fullGeometry = null;
|
this._fullGeometry = null;
|
||||||
|
|
||||||
|
this.actor.connect('destroy', this._onDestroy.bind(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
_onDestroy() {
|
||||||
|
if (this._notifyOpacityId) {
|
||||||
|
let parent = this.actor.get_parent();
|
||||||
|
if (parent)
|
||||||
|
parent.disconnect(this._notifyOpacityId);
|
||||||
|
this._notifyOpacityId = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._parentSetLater) {
|
||||||
|
Meta.later_remove(this._parentSetLater);
|
||||||
|
this._parentSetLater = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_onPan(action) {
|
_onPan(action) {
|
||||||
@ -717,7 +733,11 @@ var WorkspacesDisplay = class {
|
|||||||
oldParent.disconnect(this._notifyOpacityId);
|
oldParent.disconnect(this._notifyOpacityId);
|
||||||
this._notifyOpacityId = 0;
|
this._notifyOpacityId = 0;
|
||||||
|
|
||||||
Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => {
|
if (this._parentSetLater)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this._parentSetLater = Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => {
|
||||||
|
this._parentSetLater = 0;
|
||||||
let newParent = this.actor.get_parent();
|
let newParent = this.actor.get_parent();
|
||||||
if (!newParent)
|
if (!newParent)
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user