[gnome-control-center] user-accounts: Use g_auto in UmPasswordDialog
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] user-accounts: Use g_auto in UmPasswordDialog
- Date: Wed, 7 Nov 2018 10:17:32 +0000 (UTC)
commit cedbbd8eac8d9d7613e3609cf10cb0691d0e5f74
Author: Robert Ancell <robert ancell canonical com>
Date: Wed Nov 7 09:17:05 2018 +1300
user-accounts: Use g_auto in UmPasswordDialog
panels/user-accounts/um-password-dialog.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/panels/user-accounts/um-password-dialog.c b/panels/user-accounts/um-password-dialog.c
index b005fba92..46482f232 100644
--- a/panels/user-accounts/um-password-dialog.c
+++ b/panels/user-accounts/um-password-dialog.c
@@ -163,7 +163,7 @@ ok_button_clicked_cb (UmPasswordDialog *um)
case ACT_USER_PASSWORD_MODE_REGULAR:
if (act_user_get_uid (um->user) == getuid ()) {
GdkDisplay *display;
- GdkCursor *cursor;
+ g_autoptr(GdkCursor) cursor = NULL;
/* When setting a password for the current user,
* use passwd directly, to preserve the audit trail
@@ -176,7 +176,6 @@ ok_button_clicked_cb (UmPasswordDialog *um)
cursor = gdk_cursor_new_for_display (display, GDK_WATCH);
gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (um)), cursor);
gdk_display_flush (display);
- g_object_unref (cursor);
return;
}
@@ -397,7 +396,7 @@ old_password_entry_changed (UmPasswordDialog *um)
static void
password_entry_icon_press_cb (UmPasswordDialog *um)
{
- gchar *pwd;
+ g_autofree gchar *pwd = NULL;
pwd = pw_generate ();
if (pwd == NULL)
@@ -407,8 +406,6 @@ password_entry_icon_press_cb (UmPasswordDialog *um)
gtk_entry_set_text (um->verify_entry, pwd);
gtk_entry_set_visibility (um->password_entry, TRUE);
gtk_widget_set_sensitive (GTK_WIDGET (um->verify_entry), TRUE);
-
- g_free (pwd);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]