diff options
-rw-r--r-- | libempathy-gtk/empathy-smiley-manager.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libempathy-gtk/empathy-smiley-manager.c b/libempathy-gtk/empathy-smiley-manager.c index 9f7dd73c8..96b50206a 100644 --- a/libempathy-gtk/empathy-smiley-manager.c +++ b/libempathy-gtk/empathy-smiley-manager.c @@ -79,8 +79,9 @@ smiley_manager_tree_free (SmileyManagerTree *tree) g_slice_free (SmileyManagerTree, tree); } +/* Note: This function takes the ownership of str */ static EmpathySmiley * -smiley_new (GdkPixbuf *pixbuf, const gchar *str) +smiley_new (GdkPixbuf *pixbuf, gchar *str) { EmpathySmiley *smiley; @@ -88,7 +89,7 @@ smiley_new (GdkPixbuf *pixbuf, const gchar *str) if (pixbuf) { smiley->pixbuf = g_object_ref (pixbuf); } - smiley->str = g_strdup (str); + smiley->str = str; return smiley; } @@ -229,7 +230,8 @@ smiley_manager_add_valist (EmpathySmileyManager *manager, smiley_manager_tree_insert (priv->tree, smiley, str); } - priv->smileys = g_slist_prepend (priv->smileys, smiley_new (smiley, first_str)); + priv->smileys = g_slist_prepend (priv->smileys, + smiley_new (smiley, g_strdup (first_str))); } void |