From de5fac8d0ada19f13023a180578f8813b9ae06ff Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Thu, 7 Jul 2011 21:20:59 +0400 Subject: [PATCH 1/3] Ticket #2545: fixup of saving WInput history. Signed-off-by: Andrew Borodin --- lib/widget/input.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/widget/input.c b/lib/widget/input.c index 00db0491c..28acd0270 100644 --- a/lib/widget/input.c +++ b/lib/widget/input.c @@ -842,13 +842,13 @@ input_save_history (const gchar * event_group_name, const gchar * event_name, (void) event_group_name; (void) event_name; - if (in->history != NULL && in->history_changed && !in->is_password && - (((Widget *) in)->owner->ret_value != B_CANCEL)) + if (!in->is_password && (((Widget *) in)->owner->ret_value != B_CANCEL)) { ev_history_load_save_t *ev = (ev_history_load_save_t *) data; push_history (in, in->buffer); - history_save (ev->cfg, in->history_name, in->history); + if (in->history_changed) + history_save (ev->cfg, in->history_name, in->history); in->history_changed = FALSE; } From 630bcae4d4b9dc190ac46ec09adb09b97710bcf9 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Fri, 8 Jul 2011 12:41:47 +0400 Subject: [PATCH 2/3] (input_destroy): optimization: don't do useless actions. Signed-off-by: Andrew Borodin --- lib/widget/input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/widget/input.c b/lib/widget/input.c index 28acd0270..d6524a18f 100644 --- a/lib/widget/input.c +++ b/lib/widget/input.c @@ -866,7 +866,7 @@ input_destroy (WInput * in) exit (EXIT_FAILURE); } - input_clean (in); + input_free_completions (in); /* clean history */ if (in->history != NULL) From f3fefa67f63a3e4a4eec533688d6c0fb9b8d8b5a Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Fri, 8 Jul 2011 20:48:17 +0400 Subject: [PATCH 3/3] (push_history): fixed memory leak. Signed-off-by: Andrew Borodin --- lib/widget/input.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/widget/input.c b/lib/widget/input.c index d6524a18f..89bf2652b 100644 --- a/lib/widget/input.c +++ b/lib/widget/input.c @@ -251,6 +251,8 @@ push_history (WInput * in, const char *text) in->history_changed = TRUE; } + g_free (t); + in->need_push = FALSE; }