comparison libpurple/protocols/oscar/oscar.c @ 31399:a467e55ec3c7

Move the call to flap_connection_schedule_destroy from oscar_chat_kill to oscar_chat_leave. This avoids having flap_connection_schedule_destroy called from purple_connerr, which itself is called by flap_connection_destroy_cb I'm hoping this change fixes #5927, the oscar crash when a flap connection is disconnected.
author Mark Doliner <mark@kingant.net>
date Mon, 22 Nov 2010 10:50:32 +0000
parents 3cf95447b26c
children 04ffd3b52283
comparison
equal deleted inserted replaced
31398:3cf95447b26c 31399:a467e55ec3c7
281 /* Notify the conversation window that we've left the chat */ 281 /* Notify the conversation window that we've left the chat */
282 serv_got_chat_left(gc, purple_conv_chat_get_id(PURPLE_CONV_CHAT(cc->conv))); 282 serv_got_chat_left(gc, purple_conv_chat_get_id(PURPLE_CONV_CHAT(cc->conv)));
283 283
284 /* Destroy the chat_connection */ 284 /* Destroy the chat_connection */
285 od->oscar_chats = g_slist_remove(od->oscar_chats, cc); 285 od->oscar_chats = g_slist_remove(od->oscar_chats, cc);
286 flap_connection_schedule_destroy(cc->conn, OSCAR_DISCONNECT_DONE, NULL);
287 oscar_chat_destroy(cc); 286 oscar_chat_destroy(cc);
288 } 287 }
289 288
290 /** 289 /**
291 * This is called from the callback functions for establishing 290 * This is called from the callback functions for establishing
4449 4448
4450 purple_debug_info("oscar", "Leaving chat room %s\n", 4449 purple_debug_info("oscar", "Leaving chat room %s\n",
4451 purple_conversation_get_name(conv)); 4450 purple_conversation_get_name(conv));
4452 4451
4453 cc = find_oscar_chat(gc, purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv))); 4452 cc = find_oscar_chat(gc, purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv)));
4453 flap_connection_schedule_destroy(cc->conn, OSCAR_DISCONNECT_DONE, NULL);
4454 oscar_chat_kill(gc, cc); 4454 oscar_chat_kill(gc, cc);
4455 } 4455 }
4456 4456
4457 int oscar_send_chat(PurpleConnection *gc, int id, const char *message, PurpleMessageFlags flags) 4457 int oscar_send_chat(PurpleConnection *gc, int id, const char *message, PurpleMessageFlags flags)
4458 { 4458 {