From 48ed9fcb78275cb82f844ed91f9fe4d15d2570bd Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 23 Feb 2016 11:58:27 +0100 Subject: Fix memory leak in point density The issue was happening when having unconnected point density which will cache data but will not free it because there's no actual call to the actual sampling. Now the idea is to make sure cache is zeroed on file load and undo and then caching via RNA will free the data if any exists. This could leave us with a single copy of cache in the node if it's not used, but it's quite small amount of memory and it's not leaking. --- source/blender/render/extern/include/RE_render_ext.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/render/extern') diff --git a/source/blender/render/extern/include/RE_render_ext.h b/source/blender/render/extern/include/RE_render_ext.h index b67986666ea..075db3a8145 100644 --- a/source/blender/render/extern/include/RE_render_ext.h +++ b/source/blender/render/extern/include/RE_render_ext.h @@ -86,5 +86,7 @@ void RE_point_density_sample( const bool use_render_params, float *values); +void RE_point_density_free(struct PointDensity *pd); + #endif /* __RE_RENDER_EXT_H__ */ -- cgit v1.2.3