[gnome-shell] workspaceThumbnail: always destroy bgManager when destroyed



commit 18d850d7d681ac011b45ea04fefb8a7e96db42b5
Author: Ray Strode <rstrode redhat com>
Date:   Mon Mar 25 11:31:56 2013 -0400

    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 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/workspaceThumbnail.js b/js/ui/workspaceThumbnail.js
index 689ded0..6b631d1 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;
     },


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]