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
This commit is contained in:
Ray Strode 2013-04-04 16:12:31 -04:00
parent 1ee88a2878
commit 9eae74357a

View File

@ -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');
})
});