Motionpath: Fix memory leak on early output

This is a part of T71356.
This commit is contained in:
Sergey Sharybin
2019-11-05 14:22:07 +01:00
parent 7a93abb264
commit 63b9f8394f

View File

@@ -344,6 +344,13 @@ static void motionpath_calculate_update_range(MPathTarget *mpt,
}
}
static void motionpath_free_free_tree_data(ListBase *targets)
{
for (MPathTarget *mpt = targets->first; mpt; mpt = mpt->next) {
BLI_dlrbTree_free(&mpt->keys);
}
}
/* Perform baking of the given object's and/or its bones' transforms to motion paths
* - scene: current scene
* - ob: object whose flagged motionpaths should get calculated
@@ -444,6 +451,7 @@ void animviz_calc_motionpaths(Depsgraph *depsgraph,
}
if (sfra > efra) {
motionpath_free_free_tree_data(targets);
return;
}