cpw.maiku.media_refactor: 69be24ee: Fix two assertions related to no session...

maiku at pidgin.im maiku at pidgin.im
Tue Nov 10 22:20:31 EST 2009


-----------------------------------------------------------------
Revision: 69be24ee75b8f957cfee3cfb7fd71721078b7f81
Ancestor: 694d33fc3fc4f680b1c9ec81bdcbd753fda78b97
Author: maiku at pidgin.im
Date: 2009-11-02T23:14:33
Branch: im.pidgin.cpw.maiku.media_refactor
URL: http://d.pidgin.im/viewmtn/revision/info/69be24ee75b8f957cfee3cfb7fd71721078b7f81

Modified files:
        libpurple/media/media.c

ChangeLog: 

Fix two assertions related to no sessions being created for the media object.

-------------- next part --------------
============================================================
--- libpurple/media/media.c	a78dea3e19d599edd9145ac9ea0f1b0bfdefeafb
+++ libpurple/media/media.c	a6f38f2695e65684cb7afa71e812ca0f87ec75e7
@@ -739,7 +739,8 @@ purple_media_end(PurpleMedia *media,
 	}
 
 	/* Free the conference if no sessions left */
-	if (g_hash_table_size(media->priv->sessions) == 0) {
+	if (media->priv->sessions != NULL &&
+			g_hash_table_size(media->priv->sessions) == 0) {
 		g_signal_emit(media, purple_media_signals[STATE_CHANGED],
 				0, PURPLE_MEDIA_STATE_END,
 				NULL, NULL);
@@ -846,9 +847,12 @@ purple_media_stream_info(PurpleMedia *me
 			/* Everything that needs to be emitted has been */
 		} else if (session_id == NULL && participant == NULL) {
 			/* Emit for everything in the conference */
-			GList *sessions = g_hash_table_get_values(
+			GList *sessions = NULL;
+			GList *participants = media->priv->participants;
+
+			if (media->priv->sessions != NULL)
+				sessions = g_hash_table_get_values(
 					media->priv->sessions);
-			GList *participants = media->priv->participants;
 
 			/* Emit for sessions */
 			for (; sessions; sessions = g_list_delete_link(


More information about the Commits mailing list