background: Use Garbage Collector to dispose background
The same Meta.Background could be used by multiple instances of background actors, and so should not be disposed when the actor using it is destroyed. Instead of calling `run_dispose` directly on it, just nullify the reference on destroy method, leaving the job of doing the proper disposition to the gabage collector that keeps the proper reference count on the Meta.Background. Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/501 https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/558
This commit is contained in:
parent
1e5a8b0cd7
commit
a9234f7631
@ -265,6 +265,8 @@ var Background = class Background {
|
|||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
destroy() {
|
||||||
|
this.background = null;
|
||||||
|
|
||||||
this._cancellable.cancel();
|
this._cancellable.cancel();
|
||||||
this._removeAnimationTimeout();
|
this._removeAnimationTimeout();
|
||||||
|
|
||||||
@ -699,7 +701,6 @@ var BackgroundManager = class BackgroundManager {
|
|||||||
time: FADE_ANIMATION_TIME,
|
time: FADE_ANIMATION_TIME,
|
||||||
transition: 'easeOutQuad',
|
transition: 'easeOutQuad',
|
||||||
onComplete() {
|
onComplete() {
|
||||||
oldBackgroundActor.background.run_dispose();
|
|
||||||
oldBackgroundActor.destroy();
|
oldBackgroundActor.destroy();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user