# HG changeset patch # User Nathan Walp # Date 1046766350 0 # Node ID ba87412b1a5727880505095df87b77520fc85777 # Parent 440d3d870b84a6a469ff45ac18464ec7307b8a26 [gaim-migrate @ 4957] the black art of iterating through a list you're deleting from committer: Tailor Script diff -r 440d3d870b84 -r ba87412b1a57 src/conversation.c --- a/src/conversation.c Tue Mar 04 06:40:20 2003 +0000 +++ b/src/conversation.c Tue Mar 04 08:25:50 2003 +0000 @@ -475,13 +475,12 @@ */ if (gaim_window_get_conversation_count(win) > 0) { - for (node = g_list_first(gaim_window_get_conversations(win)); - node != NULL; - node = g_list_next(node)) + node = g_list_first(gaim_window_get_conversations(win)); + while(node != NULL) { - struct gaim_conversation *conv; - - conv = (struct gaim_conversation *)node->data; + struct gaim_conversation *conv = node->data; + + node = g_list_next(node); gaim_conversation_destroy(conv); }