From d8d046f2b3ed3d9ec3d46ac17cb185838dae8a28 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Thu, 9 Oct 2014 12:05:11 -0400 Subject: [PATCH] AuthPrompt: properly remove user widgets When replacing a user widget, we need to destroy the child, not just unparent it, or it will leak. https://bugzilla.gnome.org/show_bug.cgi?id=738256 --- js/gdm/authPrompt.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js index 4160a5668..3b435de30 100644 --- a/js/gdm/authPrompt.js +++ b/js/gdm/authPrompt.js @@ -419,11 +419,13 @@ const AuthPrompt = new Lang.Class({ }, setUser: function(user) { + let oldChild = this._userWell.get_child(); + if (oldChild) + oldChild.destroy(); + if (user) { let userWidget = new UserWidget.UserWidget(user); this._userWell.set_child(userWidget.actor); - } else { - this._userWell.set_child(null); } },