[gnome-shell] background: don't leak background objects during quick changes



commit 9eae74357ab4af94f473c3b0e29be37c19b2d145
Author: Ray Strode <rstrode redhat com>
Date:   Thu Apr 4 16:12:31 2013 -0400

    background: don't leak background objects during quick changes
    
    We currently let some backgrounds "fall through the cracks" if
    a bunch of change notifications come in at once.
    
    This commit fixes that.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=697395

 js/ui/background.js |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/background.js b/js/ui/background.js
index 88c79e2..4994c05 100644
--- a/js/ui/background.js
+++ b/js/ui/background.js
@@ -742,11 +742,15 @@ const BackgroundManager = new Lang.Class({
                                    time: FADE_ANIMATION_TIME,
                                    transition: 'easeOutQuad',
                                    onComplete: Lang.bind(this, function() {
-                                       if (this.background == background) {
+                                       if (this._newBackground == newBackground) {
                                            this.background = newBackground;
                                            this._newBackground = null;
-                                           background.actor.destroy();
+                                       } else {
+                                           newBackground.actor.destroy();
                                        }
+
+                                       background.actor.destroy();
+
                                        this.emit('changed');
                                    })
                                  });


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