static void smiley_manager_finalize (GObject *object) { EmpathySmileyManagerPriv *priv = GET_PRIV (object); smiley_manager_tree_free (priv->tree); g_slist_foreach (priv->smileys, (GFunc) smiley_free, NULL); g_slist_free (priv->smileys); }
static void smiley_manager_finalize (GObject *object) { EmpathySmileyManagerPriv *priv = GET_PRIV (object); GSList *l; smiley_manager_tree_free (priv->tree); for (l = priv->smileys; l; l = l->next) { EmpathySmiley *smiley = l->data; /* The smiley got the ownership of the path */ g_free ((gchar *) smiley->path); empathy_smiley_free (smiley); } g_slist_free (priv->smileys); }
static void smiley_manager_tree_free (SmileyManagerTree *tree) { GSList *l; if (!tree) { return; } for (l = tree->childrens; l; l = l->next) { smiley_manager_tree_free (l->data); } if (tree->pixbuf) { g_object_unref (tree->pixbuf); } g_slist_free (tree->childrens); g_slice_free (SmileyManagerTree, tree); }