From b1dcea7cf1923bff49584751118fc8cf33f659a2 Mon Sep 17 00:00:00 2001 From: Rui Matos Date: Mon, 30 Jan 2017 13:29:13 +0100 Subject: [PATCH] background: Disconnect from 'prepare-for-sleep' signal This signal connection was keeping Background instances from being garbage collected. https://bugzilla.gnome.org/show_bug.cgi?id=777934 --- js/ui/background.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/ui/background.js b/js/ui/background.js index 9b3602964..fc2789810 100644 --- a/js/ui/background.js +++ b/js/ui/background.js @@ -254,7 +254,8 @@ const Background = new Lang.Class({ this._loadAnimation(this._animation.file); })); - LoginManager.getLoginManager().connect('prepare-for-sleep', + let loginManager = LoginManager.getLoginManager(); + this._prepareForSleepId = loginManager.connect('prepare-for-sleep', (lm, aboutToSuspend) => { if (aboutToSuspend) return; @@ -283,6 +284,10 @@ const Background = new Lang.Class({ this._clock.disconnect(this._timezoneChangedId); this._timezoneChangedId = 0; + if (this._prepareForSleepId != 0) + LoginManager.getLoginManager().disconnect(this._prepareForSleepId); + this._prepareForSleepId = 0; + if (this._settingsChangedSignalId != 0) this._settings.disconnect(this._settingsChangedSignalId); this._settingsChangedSignalId = 0;