From 279a93cbc25ade081510d94c20777e16527cf475 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Mon, 8 Jun 2009 22:39:56 +0100 Subject: [PATCH] Break after deleting current item in chatroom list When I signed off, Empathy exploded. l was 0x33, which oddly enough was secretly not the address of a GList. :-) I think what happened is that empathy_chatroom_manager_remove() deleted the list node currently pointed to by l; then the loop advanced to l->next, which was now garbage. We don't need to keep iterating once we find the chatroom we were looking for, so break out of the loop. --- libempathy/empathy-chatroom-manager.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libempathy/empathy-chatroom-manager.c b/libempathy/empathy-chatroom-manager.c index ad1f8c61..44416670 100644 --- a/libempathy/empathy-chatroom-manager.c +++ b/libempathy/empathy-chatroom-manager.c @@ -662,13 +662,16 @@ chatroom_manager_chat_destroyed_cb (EmpathyTpChat *chat, continue; empathy_chatroom_set_tp_chat (chatroom, NULL); + if (!empathy_chatroom_is_favorite (chatroom)) { /* Remove the chatroom from the list, unless it's in the list of * favourites.. * FIXME this policy should probably not be in libempathy */ - empathy_chatroom_manager_remove (manager, chatroom); + chatroom_manager_remove_link (manager, l); } + + break; } } -- 2.39.2