changeset 24981:584a4f5ce4dc

Free Farsight objects better.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Mon, 15 Dec 2008 09:55:25 +0000
parents bcbc62bb2496
children 0ad1b8e950d7
files libpurple/media.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/media.c	Mon Dec 15 09:13:41 2008 +0000
+++ b/libpurple/media.c	Mon Dec 15 09:55:25 2008 +0000
@@ -265,6 +265,7 @@
 purple_media_session_free(PurpleMediaSession *session)
 {
 	g_free(session->id);
+	g_object_unref(session->session);
 	g_free(session);
 }
 
@@ -279,6 +280,9 @@
 
 	g_free(priv->name);
 
+	for (; priv->streams; priv->streams = g_list_delete_link(priv->streams, priv->streams))
+		purple_media_stream_free(priv->streams->data);
+
 	if (priv->sessions) {
 		GList *sessions = g_hash_table_get_values(priv->sessions);
 		for (; sessions; sessions = g_list_delete_link(sessions, sessions)) {
@@ -287,9 +291,6 @@
 		g_hash_table_destroy(priv->sessions);
 	}
 
-	for (; priv->streams; priv->streams = g_list_delete_link(priv->streams, priv->streams))
-		purple_media_stream_free(priv->streams->data);
-
 	if (priv->participants) {
 		GList *participants = g_hash_table_get_values(priv->participants);
 		for (; participants; participants = g_list_delete_link(participants, participants))