summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@igalia.com>2019-03-28 13:06:16 -0300
committerThibault Saunier <tsaunier@igalia.com>2019-04-15 17:11:48 -0400
commitadc4843f53ea583a32a45c1f0a54c586554759e0 (patch)
tree59510bff1164064346dc8700c72b02be70cdeb4c
parent0dcf78f3eccc85687302bb991abd8cdcd4b862f1 (diff)
xml-formatter: Plug leaks of pending groups
-rw-r--r--ges/ges-base-xml-formatter.c17
-rw-r--r--tests/check/ges/group.c1
2 files changed, 18 insertions, 0 deletions
diff --git a/ges/ges-base-xml-formatter.c b/ges/ges-base-xml-formatter.c
index f845f660..2f7b97a4 100644
--- a/ges/ges-base-xml-formatter.c
+++ b/ges/ges-base-xml-formatter.c
@@ -146,6 +146,16 @@ _free_layer_entry (LayerEntry * entry)
g_slice_free (LayerEntry, entry);
}
+static void
+_free_pending_group (PendingGroup * pgroup)
+{
+ if (pgroup->group)
+ g_object_unref (pgroup->group);
+ g_list_free (pgroup->pending_children);
+ g_slice_free (PendingGroup, pgroup);
+}
+
+
/*
enum
{
@@ -368,6 +378,9 @@ _finalize (GObject * object)
if (priv->parsecontext != NULL)
g_markup_parse_context_free (priv->parsecontext);
+ g_list_free_full (priv->groups, (GDestroyNotify) _free_pending_group);
+ priv->groups = NULL;
+
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -464,7 +477,11 @@ _add_all_groups (GESFormatter * self)
GES_TIMELINE_ELEMENT_NAME (child));
ges_container_add (GES_CONTAINER (pgroup->group), child);
}
+ pgroup->group = NULL;
}
+
+ g_list_free_full (priv->groups, (GDestroyNotify) _free_pending_group);
+ priv->groups = NULL;
}
static void
diff --git a/tests/check/ges/group.c b/tests/check/ges/group.c
index 373eacfa..aa246463 100644
--- a/tests/check/ges/group.c
+++ b/tests/check/ges/group.c
@@ -674,6 +674,7 @@ GST_START_TEST (test_group_serialization)
g_free (tmpuri);
+ gst_object_unref (timeline);
ges_deinit ();
}