From 00a9825ffb5dd8ef6c6c3c9b513aaa573543f17e Mon Sep 17 00:00:00 2001 From: Henry Wilkes Date: Fri, 1 May 2020 14:26:32 +0100 Subject: [PATCH] container: return TRUE if adding doesn't cause any errors If `add_child` and `set_parent` succeed we want to return TRUE, even if the added element is no longer a child by the end of the method. This is because some users may call ges_container_remove during `child-added`. This shouldn't be considered an error. --- ges/ges-container.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ges/ges-container.c b/ges/ges-container.c index 20b5536..5a70869 100644 --- a/ges/ges-container.c +++ b/ges/ges-container.c @@ -847,6 +847,8 @@ ges_container_add (GESContainer * container, GESTimelineElement * child) child); priv->adding_children = g_list_remove (priv->adding_children, child); + ret = TRUE; + done: /* thaw all notifies */ /* Ignore notifies for the start and duration since the child should @@ -857,7 +859,6 @@ done: g_object_thaw_notify (G_OBJECT (tmp->data)); g_object_thaw_notify (G_OBJECT (child)); g_list_free_full (current_children, gst_object_unref); - ret = ! !g_list_find (container->children, child); gst_object_unref (child); container->children_control_mode = GES_CHILDREN_UPDATE; return ret; -- 2.7.4