Update of /cvsroot/gaim/gaim/src
In directory sc8-pr-cvs1:/tmp/cvs-serv25951/src
Modified Files:
conversation.c
Log Message:
Jose' M^(a) Pe'rez Ca'ncer (jm_pc) writes:
" Closing a IM window for which the connection has been
lost causes a segfault. The problem is that gaim tries
to perform operations on a connection that has been
closed and subsequently crashes. This patch avoids
doing those operations when the connection has been closed. "
Index: conversation.c
===================================================================
RCS file: /cvsroot/gaim/gaim/src/conversation.c,v
retrieving revision 1.511
retrieving revision 1.512
diff -u -d -r1.511 -r1.512
--- conversation.c 26 Apr 2003 07:15:59 -0000 1.511
+++ conversation.c 30 Apr 2003 04:49:09 -0000 1.512
@@ -950,37 +950,40 @@
gc = gaim_conversation_get_gc(conv);
name = gaim_conversation_get_name(conv);
- prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl);
+ if (gc) {
+ /* Still connected */
+ prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl);
- if (gaim_conversation_get_type(conv) == GAIM_CONV_IM) {
- if (!(misc_options & OPT_MISC_STEALTH_TYPING))
- serv_send_typing(gc, (char *)name, NOT_TYPING);
+ if (gaim_conversation_get_type(conv) == GAIM_CONV_IM) {
+ if (!(misc_options & OPT_MISC_STEALTH_TYPING))
+ serv_send_typing(gc, (char *)name, NOT_TYPING);
- if (gc && prpl_info->convo_closed != NULL)
- prpl_info->convo_closed(gc, (char *)name);
- }
- else if (gaim_conversation_get_type(conv) == GAIM_CONV_CHAT) {
- /*
- * This is unfortunately necessary, because calling serv_chat_leave()
- * calls this gaim_conversation_destroy(), which leads to two calls
- * here.. We can't just return after this, because then it'll return
- * on the next pass. So, since serv_got_chat_left(), which is
- * eventually called from the prpl that serv_chat_leave() calls,
- * removes this conversation from the gc's buddy_chats list, we're
- * going to check to see if this exists in the list. If so, we want
- * to return after calling this, because it'll be called again. If not,
- * fall through, because it'll have already been removed, and we'd
- * be on the 2nd pass.
- *
- * Long paragraph. <-- Short sentence.
- *
- * -- ChipX86
- */
+ if (gc && prpl_info->convo_closed != NULL)
+ prpl_info->convo_closed(gc, (char *)name);
+ }
+ else if (gaim_conversation_get_type(conv) == GAIM_CONV_CHAT) {
+ /*
+ * This is unfortunately necessary, because calling serv_chat_leave()
+ * calls this gaim_conversation_destroy(), which leads to two calls
+ * here.. We can't just return after this, because then it'll return
+ * on the next pass. So, since serv_got_chat_left(), which is
+ * eventually called from the prpl that serv_chat_leave() calls,
+ * removes this conversation from the gc's buddy_chats list, we're
+ * going to check to see if this exists in the list. If so, we want
+ * to return after calling this, because it'll be called again. If not,
+ * fall through, because it'll have already been removed, and we'd
+ * be on the 2nd pass.
+ *
+ * Long paragraph. <-- Short sentence.
+ *
+ * -- ChipX86
+ */
- if (gc && g_slist_find(gc->buddy_chats, conv) != NULL) {
- serv_chat_leave(gc, gaim_chat_get_id(GAIM_CHAT(conv)));
+ if (gc && g_slist_find(gc->buddy_chats, conv) != NULL) {
+ serv_chat_leave(gc, gaim_chat_get_id(GAIM_CHAT(conv)));
- return;
+ return;
+ }
}
}
|