changeset 24352:b44e1bbd5b4a

Attempt to avoid a crash in MSN. See the comment in the code. Our MSN custom emoticon code is crashy, by the way. Basically I think the slp/slplink/slpcall/switchboard code is buggy. I think there are a lot of cross-references and they don't all clean up after themselves correctly. But I don't understand this code well enough to improve it.
author Mark Doliner <mark@kingant.net>
date Thu, 13 Nov 2008 20:59:40 +0000
parents 9d2ae3639079
children f658f9a84fe9 34dcb702d0bb
files libpurple/protocols/msn/slp.c
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/slp.c	Thu Nov 13 19:11:19 2008 +0000
+++ b/libpurple/protocols/msn/slp.c	Thu Nov 13 20:59:40 2008 +0000
@@ -847,7 +847,17 @@
 		sha1 = msn_object_get_sha1(obj);
 
 		slplink = msn_session_get_slplink(session, who);
-		slplink->swboard = swboard;
+		if (slplink->swboard != swboard) {
+			if (slplink->swboard != NULL)
+				/*
+				 * Apparently we're using a different switchboard now or
+				 * something?  I don't know if this is normal, but it
+				 * definitely happens.  So make sure the old switchboard
+				 * doesn't still have a reference to us.
+				 */
+				slplink->swboard->slplinks = g_list_remove(slplink->swboard->slplinks, slplink);
+			slplink->swboard = swboard;
+		}
 
 		/* If the conversation doesn't exist then this is a custom smiley
 		 * used in the first message in a MSN conversation: we need to create