From 3a1aafc4153b9fd33bf966fb9e6c55d8f5919e7b Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 3 Nov 2004 23:44:08 +0000 Subject: When clearing the list, use "history_list", just in case "history_current" happens to be null (that might not be possible, but this is still perhaps a bit clearer). Clear "history_current" after clearing the list, as the current entry no longer exists, so that "packet_history_add()" doesn't use the now-bogus value. svn path=/trunk/; revision=12488 --- gtk/packet_history.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gtk') diff --git a/gtk/packet_history.c b/gtk/packet_history.c index 77adc36533..917e4a3384 100644 --- a/gtk/packet_history.c +++ b/gtk/packet_history.c @@ -86,7 +86,7 @@ static void clear_list(GList *current) { next_packet = g_list_next(current); history_list = g_list_remove(history_list, current->data); current = next_packet; - } + } } @@ -120,7 +120,8 @@ void packet_history_add(gint row) { void packet_history_clear(void) { /* clear "old" list */ - clear_list(g_list_first(history_current)); + clear_list(history_list); + history_current = NULL; /* add the currently selected first row */ packet_history_add(0); -- cgit v1.2.3