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
This commit is contained in:
Owen W. Taylor 2014-10-09 12:05:11 -04:00
parent 0bec76b6ee
commit d8d046f2b3

View File

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