ges_formatter_save (GESFormatter * formatter, GESTimeline * timeline)
{
GESFormatterClass *klass;
+ GList *layers;
/* Saving an empty timeline is not allowed */
- g_return_val_if_fail (ges_timeline_get_layers (timeline) != NULL, FALSE);
+ layers = ges_timeline_get_layers (timeline);
+
+ g_return_val_if_fail (layers != NULL, FALSE);
+ g_list_foreach (layers, (GFunc) g_object_unref, NULL);
+ g_list_free (layers);
klass = GES_FORMATTER_GET_CLASS (formatter);
g_list_free (objs);
}
- for (tmp = layers; tmp; tmp = g_list_next (tmp)) {
- g_object_unref (tmp->data);
- }
+ g_list_foreach (layers, (GFunc) g_object_unref, NULL);
+ g_list_free (layers);
data = g_key_file_to_data (kf, &length, NULL);
ges_formatter_set_data (keyfile_formatter, data, length);