comparison libpurple/protocols/msn/slplink.c @ 30238:8c1a2ef5a713

Destroy a DC if its corresponding slpcall is going away and it hasn't established itself yet. Otherwise, it might timeout later and try to access the old slpcall. Fixes #12072.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sat, 03 Jul 2010 23:45:59 +0000
parents a83167dd305c
children 1cdae196aac8 47b6eda87723 e53f81486d57
comparison
equal deleted inserted replaced
30237:a14c2e81fcf0 30238:8c1a2ef5a713
212 slplink->swboard->slplinks = g_list_remove(slplink->swboard->slplinks, slplink); 212 slplink->swboard->slplinks = g_list_remove(slplink->swboard->slplinks, slplink);
213 msn_switchboard_release(slplink->swboard, MSN_SB_FLAG_FT); 213 msn_switchboard_release(slplink->swboard, MSN_SB_FLAG_FT);
214 slplink->swboard = NULL; 214 slplink->swboard = NULL;
215 } 215 }
216 216
217 /* The slplink has no slpcalls in it, release it from the DC. */ 217 if (slplink->dc != NULL) {
218 if (slplink->slp_calls == NULL && slplink->dc != NULL) { 218 if ((slplink->dc->state != DC_STATE_ESTABLISHED && slplink->dc->slpcall == slpcall)
219 slplink->dc->slplink = NULL; 219 || (slplink->slp_calls == NULL)) {
220 msn_dc_destroy(slplink->dc); 220 /* The DC is not established and its corresponding slpcall is dead,
221 slplink->dc = NULL; 221 * or the slplink has no slpcalls in it and no longer needs the DC.
222 */
223 slplink->dc->slplink = NULL;
224 msn_dc_destroy(slplink->dc);
225 slplink->dc = NULL;
226 }
222 } 227 }
223 } 228 }
224 229
225 MsnSlpCall * 230 MsnSlpCall *
226 msn_slplink_find_slp_call(MsnSlpLink *slplink, const char *id) 231 msn_slplink_find_slp_call(MsnSlpLink *slplink, const char *id)