im.pidgin.pidgin.custom_smiley: 064f7d3ecc411bfc78524a1f9c2b3915d0514af5

sadrul at pidgin.im sadrul at pidgin.im
Sun Feb 24 22:05:43 EST 2008


-----------------------------------------------------------------
Revision: 064f7d3ecc411bfc78524a1f9c2b3915d0514af5
Ancestor: d06694e5c9155025bde320aaa18406cfd2d1992e
Author: sadrul at pidgin.im
Date: 2008-02-25T03:07:03
Branch: im.pidgin.pidgin.custom_smiley
URL: http://d.pidgin.im/viewmtn/revision/info/064f7d3ecc411bfc78524a1f9c2b3915d0514af5

Modified files:
        libpurple/smiley.c libpurple/smiley.h pidgin/gtksmiley.c

ChangeLog: 

Fix a leak, and correct the docs.

-------------- next part --------------
============================================================
--- libpurple/smiley.c	70c4fea21e6decb2eb7e814fe8974a6d10ca1f6c
+++ libpurple/smiley.c	dbc314167270b961b913702b5ddfee198007de45
@@ -730,12 +730,9 @@ static void add_smiley_to_list(gpointer 
 
 static void add_smiley_to_list(gpointer key, gpointer value, gpointer user_data)
 {
-	GList** preturninglist = (GList**)user_data;
-	GList *returninglist = *preturninglist;
+	GList** returninglist = (GList**)user_data;
 
-	returninglist = g_list_append(returninglist, value);
-
-	*preturninglist = returninglist;
+	*returninglist = g_list_append(*returninglist, value);
 }
 
 GList *
============================================================
--- libpurple/smiley.h	ad36015fe70a9abc38305aabf986d180de93c601
+++ libpurple/smiley.h	8079fba520a5ea21d5b930092f95e46b99656b4b
@@ -210,9 +210,9 @@ char *purple_smiley_get_full_path(Purple
 /*@{*/
 
 /**
- * Returns a list of all custom smileys.
+ * Returns a list of all custom smileys. The caller should free the list.
  *
- * @constreturn A list of all custom smileys.
+ * @return A list of all custom smileys.
  */
 GList *
 purple_smileys_get_all(void);
============================================================
--- pidgin/gtksmiley.c	53337cdf94e1e67ce4a9c1ed4c641ee161132e6d
+++ pidgin/gtksmiley.c	945c0710a56515ab6c37266f53d13322de671aaf
@@ -80,6 +80,7 @@ static void add_gtkimhtml_to_list(GtkIMH
 	purple_debug_info("gtksmiley", "adding %s to gtk_smileys\n", gtksmiley->smile);
 }
 
+/* Perhaps this should be in gtkimhtml.c instead. -- sad */
 static GtkIMHtmlSmiley *smiley_purple_to_gtkimhtml(PurpleSmiley *smiley)
 {
 	GtkIMHtmlSmiley *gtksmiley;
@@ -141,16 +142,16 @@ void pidgin_smileys_init(void)
 
 void pidgin_smileys_init(void)
 {
-	GList *purple_smileys;
+	GList *smileys;
 	PurpleSmiley *smiley;
 
 	if (gtk_smileys != NULL)
 		return;
 
-	purple_smileys = purple_smileys_get_all();
+	smileys = purple_smileys_get_all();
 
-	for (; purple_smileys; purple_smileys = purple_smileys->next) {
-		smiley = (PurpleSmiley*)purple_smileys->data;
+	for (; smileys; smileys = g_list_delete_link(smileys, smileys)) {
+		smiley = (PurpleSmiley*)smileys->data;
 
 		pidgin_smiley_add_to_list(smiley);
 	}
@@ -432,7 +433,8 @@ static void populate_smiley_list(SmileyM
 
 	gtk_list_store_clear(dialog->model);
 
-	for(list = purple_smileys_get_all(); list != NULL; list = list->next) {
+	for(list = purple_smileys_get_all(); list != NULL;
+			list = g_list_delete_link(list, list)) {
 		emoticon = (PurpleSmiley*)list->data;
 
 		store_smiley_add(emoticon);


More information about the Commits mailing list