[Bf-blender-cvs] [63b9f8394f4] blender-v2.81-release: Motionpath: Fix memory leak on early output

Sergey Sharybin noreply at git.blender.org
Tue Nov 5 14:23:10 CET 2019


Commit: 63b9f8394f46c9b12709f7d2731f8634b888c04c
Author: Sergey Sharybin
Date:   Tue Nov 5 14:22:07 2019 +0100
Branches: blender-v2.81-release
https://developer.blender.org/rB63b9f8394f46c9b12709f7d2731f8634b888c04c

Motionpath: Fix memory leak on early output

This is a part of T71356.

===================================================================

M	source/blender/editors/animation/anim_motion_paths.c

===================================================================

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;
   }



More information about the Bf-blender-cvs mailing list