diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2009-04-03 20:49:53 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2009-04-03 20:49:53 +0800 |
commit | 256d304bd063ed5d4bd854ee5cdf9e0acd97389c (patch) | |
tree | 8ba032c5b0844571cd8fddb847a27692682ac528 | |
parent | 4cf5e56bedf7a47778e5ac07fef30f83edcc2d45 (diff) | |
download | gsoc2013-empathy-256d304bd063ed5d4bd854ee5cdf9e0acd97389c.tar gsoc2013-empathy-256d304bd063ed5d4bd854ee5cdf9e0acd97389c.tar.gz gsoc2013-empathy-256d304bd063ed5d4bd854ee5cdf9e0acd97389c.tar.bz2 gsoc2013-empathy-256d304bd063ed5d4bd854ee5cdf9e0acd97389c.tar.lz gsoc2013-empathy-256d304bd063ed5d4bd854ee5cdf9e0acd97389c.tar.xz gsoc2013-empathy-256d304bd063ed5d4bd854ee5cdf9e0acd97389c.tar.zst gsoc2013-empathy-256d304bd063ed5d4bd854ee5cdf9e0acd97389c.zip |
Remove unnecessary string dup. Fixes bug #577829
From: Xavier Claessens <xclaesse@gmail.com>
svn path=/trunk/; revision=2757
-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 |