From 10590e25f0b27668e0de81a2cff4b477a97c471f Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Wed, 18 Mar 2020 11:12:55 -0300 Subject: [PATCH] container: Let subclass know adding child was interrupted When the `child-added` signal emission was called, the `GESContainer->child_added` vmethod was called (the signal is `G_SIGNAL_RUN_FIRST`) so we need to call `GESContainer->child_removed` ourself so subclasses know they do not control the child anymore. --- ges/ges-container.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ges/ges-container.c b/ges/ges-container.c index cf093b2960..f569fcee40 100644 --- a/ges/ges-container.c +++ b/ges/ges-container.c @@ -904,7 +904,13 @@ ges_container_remove (GESContainer * container, GESTimelineElement * child) g_signal_emit (container, ges_container_signals[CHILD_REMOVED_SIGNAL], 0, child); } else { - GST_INFO_OBJECT (container, "Not emitting 'child-removed' signal as child" + GESContainerClass *klass = GES_CONTAINER_GET_CLASS (container); + + if (klass->child_removed) + klass->child_removed (container, child); + + GST_INFO_OBJECT (container, + "Not emitting 'child-removed' signal as child" " removal happend during 'child-added' signal emission"); } gst_object_unref (child);