From 99e18051942e170f9713aa42bc85df3a7d2b9edb Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Thu, 5 Jun 2003 23:51:15 +0000 Subject: [PATCH] * screen.c (panel_destroy): Rewind history to the beginning before freeing it. * widget.c (input_destroy): Likewise. * util.c (list_append_unique): Free data when removing duplicate list entries. --- src/ChangeLog | 10 +++++++++- src/screen.c | 5 +++-- src/util.c | 1 + src/widget.c | 1 + 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index f694dd95c..90062cdbc 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,6 +1,14 @@ +2003-06-05 Pavel Roskin + + * screen.c (panel_destroy): Rewind history to the beginning + before freeing it. + * widget.c (input_destroy): Likewise. + * util.c (list_append_unique): Free data when removing duplicate + list entries. + 2003-05-29 Andrew V. Samoilov - key.c (init_key): Fix crash if TERM is unset. + * key.c (init_key): Fix crash if TERM is unset. 2003-05-29 Koblinger Egmont diff --git a/src/screen.c b/src/screen.c index e0dbaf51d..797e2a3ba 100644 --- a/src/screen.c +++ b/src/screen.c @@ -896,9 +896,10 @@ panel_destroy (WPanel *p) panel_clean_dir (p); /* save and clean history */ - if (p->dir_history){ + if (p->dir_history) { history_put (p->hist_name, p->dir_history); + p->dir_history = g_list_first (p->dir_history); g_list_foreach (p->dir_history, (GFunc) g_free, NULL); g_list_free (p->dir_history); } @@ -910,7 +911,7 @@ panel_destroy (WPanel *p) g_free (p->user_format); for (i = 0; i < LIST_TYPES; i++) - g_free (p->user_status_format [i]); + g_free (p->user_status_format[i]); g_free (p->dir.list); g_free (p->panel_name); g_free (name); diff --git a/src/util.c b/src/util.c index 0e5324164..dc8a39a4c 100644 --- a/src/util.c +++ b/src/util.c @@ -1190,6 +1190,7 @@ list_append_unique (GList *list, char *text) while (link) { newlink = g_list_previous (link); if (!strcmp ((char *) link->data, text)) { + g_free (link->data); g_list_remove_link (list, link); g_list_free_1 (link); } diff --git a/src/widget.c b/src/widget.c index b54b77af8..d9b96e041 100644 --- a/src/widget.c +++ b/src/widget.c @@ -1009,6 +1009,7 @@ input_destroy (WInput *in) if (!in->is_password) /* don't save passwords ;-) */ history_put (in->history_name, in->history); + in->history = g_list_first (in->history); g_list_foreach (in->history, (GFunc) g_free, NULL); g_list_free (in->history); }