pidgin: a12c0e83: NULL-ify some reverse links so that ther...
qulogic at pidgin.im
qulogic at pidgin.im
Sun May 23 17:50:35 EDT 2010
-----------------------------------------------------------------
Revision: a12c0e83e315f6ccc2e24fd4c56217414a9393e9
Ancestor: f7edad1f1262dbc8addce444879c4e9a858c9234
Author: qulogic at pidgin.im
Date: 2010-05-23T21:45:19
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/a12c0e83e315f6ccc2e24fd4c56217414a9393e9
Modified files:
libpurple/protocols/msn/directconn.c
libpurple/protocols/msn/slplink.c
ChangeLog:
NULL-ify some reverse links so that there's no double-free on exit.
-------------- next part --------------
============================================================
--- libpurple/protocols/msn/directconn.c 1977f6ea3424252987fa18c393e67d229246f598
+++ libpurple/protocols/msn/directconn.c 21df6e8a863a710fb6c63347b6d80a863faf1071
@@ -169,16 +169,16 @@ msn_dc_destroy(MsnDirectConn *dc)
g_return_if_fail(dc != NULL);
- slplink = dc->slplink;
-
if (dc->slpcall != NULL)
dc->slpcall->wait_for_socket = FALSE;
- slplink->dc = NULL;
+ slplink = dc->slplink;
+ if (slplink) {
+ slplink->dc = NULL;
+ if (slplink->swboard == NULL)
+ msn_slplink_destroy(slplink);
+ }
- if (slplink->swboard == NULL)
- msn_slplink_destroy(slplink);
-
g_free(dc->msg_body);
if (dc->prev_ack) {
============================================================
--- libpurple/protocols/msn/slplink.c 0f8dc33f326ea07617c73a179ee8a1ca29ff1a82
+++ libpurple/protocols/msn/slplink.c 1166e363870cf37a0c04253dd35d33bcad84b085
@@ -101,8 +101,11 @@ msn_slplink_destroy(MsnSlpLink *slplink)
session = slplink->session;
- if (slplink->dc != NULL)
+ if (slplink->dc != NULL) {
+ slplink->dc->slplink = NULL;
msn_dc_destroy(slplink->dc);
+ slplink->dc = NULL;
+ }
while (slplink->slp_calls != NULL)
msn_slpcall_destroy(slplink->slp_calls->data);
@@ -203,12 +206,16 @@ msn_slplink_remove_slpcall(MsnSlpLink *s
/* The slplink has no slpcalls in it, release it from MSN_SB_FLAG_FT.
* If nothing else is using it then this might cause swboard to be
* destroyed. */
- if (slplink->slp_calls == NULL && slplink->swboard != NULL)
+ if (slplink->slp_calls == NULL && slplink->swboard != NULL) {
msn_switchboard_release(slplink->swboard, MSN_SB_FLAG_FT);
+ slplink->swboard = NULL;
+ }
/* The slplink has no slpcalls in it, release it from the DC. */
- if (slplink->slp_calls == NULL && slplink->dc != NULL)
+ if (slplink->slp_calls == NULL && slplink->dc != NULL) {
msn_dc_destroy(slplink->dc);
+ slplink->dc = NULL;
+ }
}
MsnSlpCall *
More information about the Commits
mailing list