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
This commit is contained in:
Giovanni Campagna 2014-01-22 20:17:15 +01:00
parent 9d8f8277aa
commit 816f5162f9

View File

@ -748,14 +748,16 @@ const BackgroundManager = new Lang.Class({
time: FADE_ANIMATION_TIME, time: FADE_ANIMATION_TIME,
transition: 'easeOutQuad', transition: 'easeOutQuad',
onComplete: Lang.bind(this, function() { onComplete: Lang.bind(this, function() {
if (this._newBackground == newBackground) { if (this._newBackground != newBackground) {
this.background = newBackground; /* Not interesting, we queued another load */
this._newBackground = null;
} else {
newBackground.actor.destroy(); newBackground.actor.destroy();
return;
} }
this.background.actor.destroy(); this.background.actor.destroy();
this.background = newBackground;
this._newBackground = null;
this.emit('changed'); this.emit('changed');
}) })
}); });