diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2012-03-16 19:24:04 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2012-03-16 19:24:04 -0500 |
commit | ddd26808cecb8050db7438ee59b3bab3f6ba4612 (patch) | |
tree | 4bad825f2717b123d12fd56cc1f629369020476d /src/indicator-session.c | |
parent | 537804ecacb2732a6e86a4234f7173cd54f3b095 (diff) | |
download | ayatana-indicator-session-ddd26808cecb8050db7438ee59b3bab3f6ba4612.tar.gz ayatana-indicator-session-ddd26808cecb8050db7438ee59b3bab3f6ba4612.tar.bz2 ayatana-indicator-session-ddd26808cecb8050db7438ee59b3bab3f6ba4612.zip |
fix memory leak updating the username label -- gtk_label_set_text() takes a const char*, we don't need to g_strdup() the string before passing it in
Diffstat (limited to 'src/indicator-session.c')
-rw-r--r-- | src/indicator-session.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/indicator-session.c b/src/indicator-session.c index 0051af1..c6f4d9c 100644 --- a/src/indicator-session.c +++ b/src/indicator-session.c @@ -713,14 +713,8 @@ indicator_session_update_users_label (IndicatorSession* self, } GSettings* settings = g_settings_new ("com.canonical.indicator.session"); - gboolean use_name = g_settings_get_boolean (settings, - "show-real-name-on-panel"); + const gboolean use_name = g_settings_get_boolean (settings, "show-real-name-on-panel"); + gtk_label_set_text (self->users.label, name); + gtk_widget_set_visible (GTK_WIDGET(self->users.label), use_name); g_object_unref (settings); - gtk_label_set_text (self->users.label, g_strdup(name)); - if (use_name){ - gtk_widget_show(GTK_WIDGET(self->users.label)); - } - else{ - gtk_widget_hide(GTK_WIDGET(self->users.label)); - } } |