mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
GESTimeline: release timeline objects when a layer is removed
This commit is contained in:
parent
293cc5c6ca
commit
f521d31b40
1 changed files with 12 additions and 0 deletions
|
@ -566,6 +566,8 @@ ges_timeline_add_layer (GESTimeline * timeline, GESTimelineLayer * layer)
|
|||
gboolean
|
||||
ges_timeline_remove_layer (GESTimeline * timeline, GESTimelineLayer * layer)
|
||||
{
|
||||
GList *layer_objects, *tmp;
|
||||
|
||||
GST_DEBUG ("timeline:%p, layer:%p", timeline, layer);
|
||||
|
||||
if (G_UNLIKELY (!g_list_find (timeline->layers, layer))) {
|
||||
|
@ -573,6 +575,16 @@ ges_timeline_remove_layer (GESTimeline * timeline, GESTimelineLayer * layer)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/* remove objects from any private data structures */
|
||||
|
||||
layer_objects = ges_timeline_layer_get_objects (layer);
|
||||
for (tmp = layer_objects; tmp; tmp = tmp->next) {
|
||||
layer_object_removed_cb (layer, GES_TIMELINE_OBJECT (tmp->data), timeline);
|
||||
g_object_unref (G_OBJECT (tmp->data));
|
||||
tmp->data = NULL;
|
||||
}
|
||||
g_list_free (layer_objects);
|
||||
|
||||
/* Disconnect signals */
|
||||
GST_DEBUG ("Disconnecting signal callbacks");
|
||||
g_signal_handlers_disconnect_by_func (layer, layer_object_added_cb, timeline);
|
||||
|
|
Loading…
Reference in a new issue