Fix memory leak duplicating sequencer strips

Regression in [0] also skip creating a GSet when there are no F-curves.

[0]: e74420124f
This commit is contained in:
Campbell Barton 2022-04-05 09:22:32 +10:00
parent 11183ebc3c
commit 25a283acce
Notes: blender-bot 2023-02-14 04:20:36 +01:00
Referenced by issue #95887, Sequencer: Memory leak after duplicating a strip
1 changed files with 5 additions and 0 deletions

View File

@ -126,10 +126,15 @@ void SEQ_animation_restore_original(Scene *scene, ListBase *list)
void SEQ_animation_duplicate(Scene *scene, Sequence *seq, ListBase *list)
{
if (BLI_listbase_is_empty(list)) {
return;
}
GSet *fcurves = SEQ_fcurves_by_strip_get(seq, list);
GSET_FOREACH_BEGIN (FCurve *, fcu, fcurves) {
FCurve *fcu_cpy = BKE_fcurve_copy(fcu);
BLI_addtail(&scene->adt->action->curves, fcu_cpy);
}
GSET_FOREACH_END();
BLI_gset_free(fcurves, NULL);
}