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:
authorJoshua Leung <aligorith@gmail.com>2018-08-23 07:02:09 +0300
committerJoshua Leung <aligorith@gmail.com>2018-08-23 08:07:38 +0300
commitdcefce5eae9bdcc2b0fdcbc371fcf17e0ef0ada0 (patch)
treed011047cc6135d3331c9ec08c9a64edf3d5b8962 /source/blender/editors/armature/pose_edit.c
parent18c7dfa8dc082f78b55d5dd59bee6c532682bf3f (diff)
Fix memory leak - the temporary depsgraph instance was not getting freed after use
Diffstat (limited to 'source/blender/editors/armature/pose_edit.c')
-rw-r--r--source/blender/editors/armature/pose_edit.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c
index 3586a219fd8..2445a3dc062 100644
--- a/source/blender/editors/armature/pose_edit.c
+++ b/source/blender/editors/armature/pose_edit.c
@@ -198,6 +198,7 @@ void ED_pose_recalculate_paths(bContext *C, Scene *scene, Object *ob)
struct Main *bmain = CTX_data_main(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
ListBase targets = {NULL, NULL};
+ bool free_depsgraph = false;
/* Override depsgraph with a filtered, simpler copy */
if (G.debug_value == 555) {
@@ -210,6 +211,7 @@ TIMEIT_START(filter_pose_depsgraph);
BLI_addtail(&query.targets, dft_ob);
depsgraph = DEG_graph_filter(depsgraph, bmain, &query);
+ free_depsgraph = true;
MEM_freeN(dft_ob);
TIMEIT_END(filter_pose_depsgraph);
@@ -233,6 +235,11 @@ TIMEIT_END(pose_path_calc);
/* tag armature object for copy on write - so paths will draw/redraw */
DEG_id_tag_update(&ob->id, DEG_TAG_COPY_ON_WRITE);
+
+ /* Free temporary depsgraph instance */
+ if (free_depsgraph) {
+ DEG_graph_free(depsgraph);
+ }
}