Mercurial > pidgin
comparison libpurple/protocols/msn/slplink.c @ 30088:e432507151d1
NULL-ify some reverse links so that there's no double-free on exit.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Sun, 23 May 2010 21:45:19 +0000 |
parents | 11e748b759a2 |
children | 287fc4ac2bd9 |
comparison
equal
deleted
inserted
replaced
30087:a4527d9ee853 | 30088:e432507151d1 |
---|---|
99 return; | 99 return; |
100 } | 100 } |
101 | 101 |
102 session = slplink->session; | 102 session = slplink->session; |
103 | 103 |
104 if (slplink->dc != NULL) | 104 if (slplink->dc != NULL) { |
105 slplink->dc->slplink = NULL; | |
105 msn_dc_destroy(slplink->dc); | 106 msn_dc_destroy(slplink->dc); |
107 slplink->dc = NULL; | |
108 } | |
106 | 109 |
107 while (slplink->slp_calls != NULL) | 110 while (slplink->slp_calls != NULL) |
108 msn_slpcall_destroy(slplink->slp_calls->data); | 111 msn_slpcall_destroy(slplink->slp_calls->data); |
109 | 112 |
110 g_queue_free(slplink->slp_msg_queue); | 113 g_queue_free(slplink->slp_msg_queue); |
201 slplink->slp_calls = g_list_remove(slplink->slp_calls, slpcall); | 204 slplink->slp_calls = g_list_remove(slplink->slp_calls, slpcall); |
202 | 205 |
203 /* The slplink has no slpcalls in it, release it from MSN_SB_FLAG_FT. | 206 /* The slplink has no slpcalls in it, release it from MSN_SB_FLAG_FT. |
204 * If nothing else is using it then this might cause swboard to be | 207 * If nothing else is using it then this might cause swboard to be |
205 * destroyed. */ | 208 * destroyed. */ |
206 if (slplink->slp_calls == NULL && slplink->swboard != NULL) | 209 if (slplink->slp_calls == NULL && slplink->swboard != NULL) { |
207 msn_switchboard_release(slplink->swboard, MSN_SB_FLAG_FT); | 210 msn_switchboard_release(slplink->swboard, MSN_SB_FLAG_FT); |
211 slplink->swboard = NULL; | |
212 } | |
208 | 213 |
209 /* The slplink has no slpcalls in it, release it from the DC. */ | 214 /* The slplink has no slpcalls in it, release it from the DC. */ |
210 if (slplink->slp_calls == NULL && slplink->dc != NULL) | 215 if (slplink->slp_calls == NULL && slplink->dc != NULL) { |
211 msn_dc_destroy(slplink->dc); | 216 msn_dc_destroy(slplink->dc); |
217 slplink->dc = NULL; | |
218 } | |
212 } | 219 } |
213 | 220 |
214 MsnSlpCall * | 221 MsnSlpCall * |
215 msn_slplink_find_slp_call(MsnSlpLink *slplink, const char *id) | 222 msn_slplink_find_slp_call(MsnSlpLink *slplink, const char *id) |
216 { | 223 { |