From 816f5162f96d5af2f4af21c028cad09297ab9b2b Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Wed, 22 Jan 2014 20:17:15 +0100 Subject: [PATCH] BackgroundManager: don't destroy the newly created actor Because we were setting this.background before calling .destroy(), the call that was meant to destroy the old background was actually destroying the new one! https://bugzilla.gnome.org/show_bug.cgi?id=722787 --- js/ui/background.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/js/ui/background.js b/js/ui/background.js index f4d486cf4..3a7541cb5 100644 --- a/js/ui/background.js +++ b/js/ui/background.js @@ -748,14 +748,16 @@ const BackgroundManager = new Lang.Class({ time: FADE_ANIMATION_TIME, transition: 'easeOutQuad', onComplete: Lang.bind(this, function() { - if (this._newBackground == newBackground) { - this.background = newBackground; - this._newBackground = null; - } else { + if (this._newBackground != newBackground) { + /* Not interesting, we queued another load */ newBackground.actor.destroy(); + return; } this.background.actor.destroy(); + this.background = newBackground; + this._newBackground = null; + this.emit('changed'); }) });