From 744161046c02bec9e298da10f70451518ecac0ae Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Sun, 29 Jun 2008 11:03:44 +0000 Subject: [PATCH] Fix a huge leak as messages were pushed in the statusbar but almost never 2008-06-29 Cosimo Cecchi * src/nautilus-window.c: (nautilus_window_set_status): Fix a huge leak as messages were pushed in the statusbar but almost never popped. Patch by Vincent Untz. (#536968). svn path=/trunk/; revision=14298 --- ChangeLog | 6 ++++++ src/nautilus-window.c | 17 +++-------------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5b2b81fdf..0b2f2476b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-06-29 Cosimo Cecchi + + * src/nautilus-window.c: (nautilus_window_set_status): + Fix a huge leak as messages were pushed in the statusbar but almost + never popped. Patch by Vincent Untz. (#536968). + 2008-06-29 Christian Neumair * libnautilus-private/nautilus-icon-container.c diff --git a/src/nautilus-window.c b/src/nautilus-window.c index bfd81168e..30b46daf1 100644 --- a/src/nautilus-window.c +++ b/src/nautilus-window.c @@ -201,27 +201,16 @@ nautilus_window_ui_update (NautilusWindow *window) gtk_ui_manager_ensure_update (window->details->ui_manager); } -static gboolean -nautilus_window_clear_status (gpointer callback_data) -{ - NautilusWindow *window; - - window = NAUTILUS_WINDOW (callback_data); - - gtk_statusbar_pop (GTK_STATUSBAR (window->details->statusbar), 0); /* clear any previous message, underflow is allowed */ - - return FALSE; -} - void nautilus_window_set_status (NautilusWindow *window, const char *text) { g_return_if_fail (NAUTILUS_IS_WINDOW (window)); + /* clear any previous message, underflow is allowed */ + gtk_statusbar_pop (GTK_STATUSBAR (window->details->statusbar), 0); + if (text != NULL && text[0] != '\0') { gtk_statusbar_push (GTK_STATUSBAR (window->details->statusbar), 0, text); - } else { - nautilus_window_clear_status (window); } } -- GitLab