* 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.
This commit is contained in:
Pavel Roskin 2003-06-05 23:51:15 +00:00
parent 4a398f0ee7
commit 99e1805194
4 changed files with 14 additions and 3 deletions

View File

@ -1,6 +1,14 @@
2003-06-05 Pavel Roskin <proski@gnu.org>
* 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 <sav@bcs.zp.ua> 2003-05-29 Andrew V. Samoilov <sav@bcs.zp.ua>
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 <egmont@uhulinux.hu> 2003-05-29 Koblinger Egmont <egmont@uhulinux.hu>

View File

@ -896,9 +896,10 @@ panel_destroy (WPanel *p)
panel_clean_dir (p); panel_clean_dir (p);
/* save and clean history */ /* save and clean history */
if (p->dir_history){ if (p->dir_history) {
history_put (p->hist_name, 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_foreach (p->dir_history, (GFunc) g_free, NULL);
g_list_free (p->dir_history); g_list_free (p->dir_history);
} }
@ -910,7 +911,7 @@ panel_destroy (WPanel *p)
g_free (p->user_format); g_free (p->user_format);
for (i = 0; i < LIST_TYPES; i++) 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->dir.list);
g_free (p->panel_name); g_free (p->panel_name);
g_free (name); g_free (name);

View File

@ -1190,6 +1190,7 @@ list_append_unique (GList *list, char *text)
while (link) { while (link) {
newlink = g_list_previous (link); newlink = g_list_previous (link);
if (!strcmp ((char *) link->data, text)) { if (!strcmp ((char *) link->data, text)) {
g_free (link->data);
g_list_remove_link (list, link); g_list_remove_link (list, link);
g_list_free_1 (link); g_list_free_1 (link);
} }

View File

@ -1009,6 +1009,7 @@ input_destroy (WInput *in)
if (!in->is_password) /* don't save passwords ;-) */ if (!in->is_password) /* don't save passwords ;-) */
history_put (in->history_name, in->history); 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_foreach (in->history, (GFunc) g_free, NULL);
g_list_free (in->history); g_list_free (in->history);
} }