Stability: null out destroyed actors

Acting on destroyed actors crashes 3.32 so make sure to null out references.
This commit is contained in:
Tor Hedin Brønner
2019-04-15 21:01:02 +02:00
parent c9bcebd1be
commit ff8d8c4d45
5 changed files with 27 additions and 8 deletions
+3
View File
@@ -103,6 +103,7 @@ class LiveAltTab extends AltTab.WindowSwitcherPopup {
let to = this._switcherList.windows[num];
this.clone && this.clone.destroy();
this.clone = null;
let actor = to.get_compositor_private();
let frame = to.get_frame_rect();
@@ -152,8 +153,10 @@ class LiveAltTab extends AltTab.WindowSwitcherPopup {
transition: 'easeInOutQuad',
onComplete: () => {
this.fog.destroy();
this.fog = null;
// this.space.cloneContainer.remove_effect(this.blur);
this.clone && this.clone.destroy();
this.clone = null;
this.space.moveDone();
}
});
+1
View File
@@ -288,5 +288,6 @@ class Minimap extends Array {
this.signals.destroy();
this.splice(0,this.length);
this.actor.destroy();
this.actor = null;
}
}
+1
View File
@@ -171,6 +171,7 @@ var ActionDispatcher = class {
Mainloop.source_remove(this._noModsTimeoutId);
Main.popModal(this.actor);
this.actor.destroy();
this.actor = null;
// We have already destroyed the navigator
!this._destroy && this.navigator.destroy();
}
+12 -6
View File
@@ -143,8 +143,10 @@ class ClickOverlay {
for (let overlay of [this.left, this.right]) {
let actor = overlay.overlay;
overlay.signals.destroy();
if (overlay.clone)
if (overlay.clone) {
overlay.clone.destroy();
overlay.clone = null;
}
actor.destroy();
overlay.removeBarrier();
}
@@ -175,8 +177,10 @@ var StackOverlay = class StackOverlay {
this.signals = new utils.Signals();
this.signals.connect(overlay, 'button-release-event', () => {
Main.activateWindow(this.target);
if (this.clone)
if (this.clone) {
this.clone.destroy();
this.clone = null;
}
return true;
});
@@ -197,8 +201,10 @@ var StackOverlay = class StackOverlay {
if ("_previewId" in this)
return;
this._previewId = Mainloop.timeout_add(100, () => {
if (this.clone)
if (this.clone) {
this.clone.destroy();
this.clone = null;
}
let [x, y, mask] = global.get_pointer();
let actor = this.target.get_compositor_private();
@@ -230,7 +236,7 @@ var StackOverlay = class StackOverlay {
return;
this.clone.destroy();
delete this.clone;
this.clone = null;
let space = Tiling.spaces.spaceOfWindow(this.target);
// Show the WindowActors again and re-apply clipping
space.moveDone();
@@ -290,9 +296,9 @@ var StackOverlay = class StackOverlay {
setTarget(space, index) {
if (this.clone && this.clone.mapped) {
if (this.clone) {
this.clone.destroy();
delete this.clone;
this.clone = null;
}
let bail = () => {
+10 -2
View File
@@ -1047,8 +1047,11 @@ class Space extends Array {
destroy() {
this.signals.destroy();
this.background.destroy();
this.background = null;
this.cloneContainer.destroy();
this.cloneContainer = null;
this.clip.destroy();
this.cloneContainer = null;
let workspace = this.workspace;
}
}
@@ -1267,8 +1270,10 @@ class Spaces extends Map {
let actor = metaWindow.get_compositor_private();
actor.remove_clip();
if (metaWindow.clone)
if (metaWindow.clone) {
metaWindow.clone.destroy();
metaWindow.clone = null;
}
if (metaWindow.get_workspace() === workspaceManager.get_active_workspace()
&& !metaWindow.minimized)
@@ -1287,6 +1292,7 @@ class Spaces extends Map {
}
this.spaceContainer.destroy();
this.spaceContainer = null;
}
workspacesChanged() {
@@ -1838,8 +1844,10 @@ function remove_handler(workspace, meta_window) {
let actor = meta_window.get_compositor_private();
if (!actor) {
signals.disconnect(meta_window);
if (meta_window.clone && meta_window.clone.mapped)
if (meta_window.clone && meta_window.clone.mapped) {
meta_window.clone.destroy();
meta_window.clone = null;
}
}
}