container: Call _remove_child when cannot set parent

ges_container_add removes the child being added if the call to
ges_timeline_element_set_parent fails. In this case, subclasses should
be given the chance to revert the effects of the add_child vmethod which
has just been called.
This commit is contained in:
Alexandru Băluț 2019-04-11 23:58:48 +02:00 committed by Thibault Saunier
parent 134e2ffae1
commit 07ee386d30

View file

@ -776,6 +776,8 @@ ges_container_add (GESContainer * container, GESTimelineElement * child)
if (ges_timeline_element_set_parent (child, GES_TIMELINE_ELEMENT (container))
== FALSE) {
if (class->remove_child)
class->remove_child (container, child);
g_hash_table_remove (priv->mappings, child);
container->children = g_list_remove (container->children, child);