aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-11-24 19:05:59 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-11-24 19:05:59 +0800
commit69afcc40e1fb02956b8ee0fad404b9afc776f64e (patch)
tree9554841ca2b70f9960b7231dbb24ff873dd8c90a
parent0313474daf288bd973ea491c530d26dd2df0fd28 (diff)
downloadgsoc2013-empathy-69afcc40e1fb02956b8ee0fad404b9afc776f64e.tar
gsoc2013-empathy-69afcc40e1fb02956b8ee0fad404b9afc776f64e.tar.gz
gsoc2013-empathy-69afcc40e1fb02956b8ee0fad404b9afc776f64e.tar.bz2
gsoc2013-empathy-69afcc40e1fb02956b8ee0fad404b9afc776f64e.tar.lz
gsoc2013-empathy-69afcc40e1fb02956b8ee0fad404b9afc776f64e.tar.xz
gsoc2013-empathy-69afcc40e1fb02956b8ee0fad404b9afc776f64e.tar.zst
gsoc2013-empathy-69afcc40e1fb02956b8ee0fad404b9afc776f64e.zip
smiley-manager: clean up memory management of the path
-rw-r--r--libempathy-gtk/empathy-smiley-manager.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libempathy-gtk/empathy-smiley-manager.c b/libempathy-gtk/empathy-smiley-manager.c
index f3447451f..a589d300a 100644
--- a/libempathy-gtk/empathy-smiley-manager.c
+++ b/libempathy-gtk/empathy-smiley-manager.c
@@ -39,7 +39,7 @@ typedef struct {
struct _SmileyManagerTree {
gunichar c;
GdkPixbuf *pixbuf;
- const gchar *path;
+ gchar *path;
GSList *childrens;
};
@@ -78,6 +78,7 @@ smiley_manager_tree_free (SmileyManagerTree *tree)
g_object_unref (tree->pixbuf);
}
g_slist_free (tree->childrens);
+ g_free (tree->path);
g_slice_free (SmileyManagerTree, tree);
}
@@ -209,13 +210,13 @@ smiley_manager_tree_insert (SmileyManagerTree *tree,
}
child->pixbuf = g_object_ref (pixbuf);
- child->path = path;
+ child->path = g_strdup (path);
}
static void
smiley_manager_add_valist (EmpathySmileyManager *manager,
GdkPixbuf *pixbuf,
- gchar *path,
+ const gchar *path,
const gchar *first_str,
va_list var_args)
{
@@ -227,7 +228,6 @@ smiley_manager_add_valist (EmpathySmileyManager *manager,
smiley_manager_tree_insert (priv->tree, pixbuf, str, path);
}
- /* We give the ownership of path to the smiley */
g_object_set_data_full (G_OBJECT (pixbuf), "smiley_str",
g_strdup (first_str), g_free);
smiley = smiley_new (pixbuf, first_str);
@@ -256,6 +256,7 @@ empathy_smiley_manager_add (EmpathySmileyManager *manager,
smiley_manager_add_valist (manager, pixbuf, path, first_str, var_args);
va_end (var_args);
g_object_unref (pixbuf);
+ g_free (path);
}
}