pidgin: ab6bb200: Destroy a DC if its corresponding slpcal...

qulogic at pidgin.im qulogic at pidgin.im
Sat Jul 3 19:50:56 EDT 2010


----------------------------------------------------------------------
Revision: ab6bb200fc9274b04542f7161ebc2f03db5b1585
Parent:   3e7f2279dc6c1caa056e4346e019dfdaab8af2b2
Author:   qulogic at pidgin.im
Date:     07/03/10 19:45:59
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/ab6bb200fc9274b04542f7161ebc2f03db5b1585

Changelog: 

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.

Changes against parent 3e7f2279dc6c1caa056e4346e019dfdaab8af2b2

  patched  libpurple/protocols/msn/slplink.c

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/slplink.c	a5fe1987fa202665700e8e8c0585d2ff121e39d8
+++ libpurple/protocols/msn/slplink.c	1f9104a14bb53e520506da7d1fc5c571306dba7a
@@ -214,11 +214,16 @@ msn_slplink_remove_slpcall(MsnSlpLink *s
 		slplink->swboard = NULL;
 	}
 
-	/* The slplink has no slpcalls in it, release it from the DC. */
-	if (slplink->slp_calls == NULL && slplink->dc != NULL) {
-		slplink->dc->slplink = NULL;
-		msn_dc_destroy(slplink->dc);
-		slplink->dc = NULL;
+	if (slplink->dc != NULL) {
+		if ((slplink->dc->state != DC_STATE_ESTABLISHED && slplink->dc->slpcall == slpcall)
+		 || (slplink->slp_calls == NULL)) {
+			/* The DC is not established and its corresponding slpcall is dead,
+			 * or the slplink has no slpcalls in it and no longer needs the DC.
+			 */
+			slplink->dc->slplink = NULL;
+			msn_dc_destroy(slplink->dc);
+			slplink->dc = NULL;
+		}
 	}
 }
 


More information about the Commits mailing list