Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2019-11-05 16:22:07 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-11-05 16:23:01 +0300
commit63b9f8394f46c9b12709f7d2731f8634b888c04c (patch)
treedbe8eb110026b6190e536c9f2a5afbcd4c9302ad /source/blender/editors/animation/anim_motion_paths.c
parent7a93abb2646f3325946c4101b9ec71c58abe1f68 (diff)
Motionpath: Fix memory leak on early output
This is a part of T71356.
Diffstat (limited to 'source/blender/editors/animation/anim_motion_paths.c')
-rw-r--r--source/blender/editors/animation/anim_motion_paths.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/editors/animation/anim_motion_paths.c b/source/blender/editors/animation/anim_motion_paths.c
index 30bf837f6c0..e4eabf43493 100644
--- a/source/blender/editors/animation/anim_motion_paths.c
+++ b/source/blender/editors/animation/anim_motion_paths.c
@@ -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;
}