[Telepathy-commits] [telepathy-gabble/master] Sanify freeing of lists of codecs.

Will Thompson will.thompson at collabora.co.uk
Thu Mar 5 08:49:43 PST 2009


l = g_list_remove (l, l->data) is equivalent to
l = g_list_delete_link (l, l) except silly. :)
---
 src/jingle-media-rtp.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/jingle-media-rtp.c b/src/jingle-media-rtp.c
index d65ab25..e6436fc 100644
--- a/src/jingle-media-rtp.c
+++ b/src/jingle-media-rtp.c
@@ -138,9 +138,8 @@ jingle_media_rtp_free_codecs (GList *codecs)
 {
   while (codecs != NULL)
     {
-      JingleCodec *p = (JingleCodec *) codecs->data;
-      jingle_media_rtp_codec_free (p);
-      codecs = g_list_remove (codecs, p);
+      jingle_media_rtp_codec_free (codecs->data);
+      codecs = g_list_delete_link (codecs, codecs);
     }
 }
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list