diff options
author | Guy Harris <guy@alum.mit.edu> | 2004-11-03 23:44:08 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2004-11-03 23:44:08 +0000 |
commit | 3a1aafc4153b9fd33bf966fb9e6c55d8f5919e7b (patch) | |
tree | de4720a3a98d636ff27233bf18458f5aede3e594 /gtk/packet_history.c | |
parent | 019dc3054380a10f16db28bb855e93e8104af377 (diff) | |
download | wireshark-3a1aafc4153b9fd33bf966fb9e6c55d8f5919e7b.tar.gz |
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
Diffstat (limited to 'gtk/packet_history.c')
-rw-r--r-- | gtk/packet_history.c | 5 |
1 files changed, 3 insertions, 2 deletions
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); |