libpurple/protocols/msn/switchboard.c

branch
cpw.qulogic.msnp16
changeset 30930
bea746046da3
parent 30921
a3cbc0e5a3c0
parent 30089
76cd0d853f80
child 30933
e8fb33bb8635
child 30940
fd3559f6d13c
--- a/libpurple/protocols/msn/switchboard.c	Mon May 10 23:21:44 2010 +0000
+++ b/libpurple/protocols/msn/switchboard.c	Sat May 22 06:27:18 2010 +0000
@@ -87,8 +87,17 @@
 		purple_timeout_remove(swboard->reconn_timeout_h);
 
 	/* If it linked us is because its looking for trouble */
-	while (swboard->slplinks != NULL)
-		msn_slplink_destroy(swboard->slplinks->data);
+	while (swboard->slplinks != NULL) {
+		MsnSlpLink *slplink = swboard->slplinks->data;
+
+		/* Destroy only those slplinks which use the switchboard */
+		if (slplink->dc == NULL)
+			msn_slplink_destroy(slplink);
+		else {
+			swboard->slplinks = g_list_remove(swboard->slplinks, slplink);
+			slplink->swboard = NULL;
+		}
+	}
 
 	/* Destroy the message queue */
 	while ((msg = g_queue_pop_head(swboard->msg_queue)) != NULL)

mercurial