From 18d850d7d681ac011b45ea04fefb8a7e96db42b5 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Mon, 25 Mar 2013 11:31:56 -0400 Subject: [PATCH] workspaceThumbnail: always destroy bgManager when destroyed Right now we only destroy the bgManager object when the workspaceThumbnail is explicitly destroy with its destroy() method. This commit makes sure bgManager gets destroyed when the workspaceThumbnail actor is destroyed without calling destroy(). https://bugzilla.gnome.org/show_bug.cgi?id=696157 --- js/ui/workspaceThumbnail.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/js/ui/workspaceThumbnail.js b/js/ui/workspaceThumbnail.js index 689ded035..6b631d1d9 100644 --- a/js/ui/workspaceThumbnail.js +++ b/js/ui/workspaceThumbnail.js @@ -384,9 +384,8 @@ const WorkspaceThumbnail = new Lang.Class({ }, destroy : function() { - this.actor.destroy(); - this._bgManager.destroy(); - this._bgManager = null; + if (this.actor) + this.actor.destroy(); }, workspaceRemoved : function() { @@ -407,6 +406,11 @@ const WorkspaceThumbnail = new Lang.Class({ _onDestroy: function(actor) { this.workspaceRemoved(); + if (this._bgManager) { + this._bgManager.destroy(); + this._bgManager = null; + } + this._windows = []; this.actor = null; },