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>2018-05-11 16:40:14 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-05-11 16:40:46 +0300
commit2f0aca45966c3459a08f3f7e371ead764b19adfb (patch)
treef9cceeaf9e599b6cf5f71050edb82f670733dc69 /source/blender/draw/intern/draw_cache_impl_particles.c
parentb5beb660b35aa1c4f62031a158a9a92c1390e05c (diff)
Particle mode: Fix memory leak with simple interpolated children
Diffstat (limited to 'source/blender/draw/intern/draw_cache_impl_particles.c')
-rw-r--r--source/blender/draw/intern/draw_cache_impl_particles.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_particles.c b/source/blender/draw/intern/draw_cache_impl_particles.c
index 1c39cbc16cd..a73731bec2f 100644
--- a/source/blender/draw/intern/draw_cache_impl_particles.c
+++ b/source/blender/draw/intern/draw_cache_impl_particles.c
@@ -277,7 +277,18 @@ static void particle_calculate_uvs(ParticleSystem *psys,
float (**r_parent_uvs)[2],
float (**r_uv)[2])
{
- if (psmd != NULL) {
+ if (psmd == NULL) {
+ return;
+ }
+ if (is_simple) {
+ if (r_parent_uvs[parent_index] != NULL) {
+ *r_uv = r_parent_uvs[parent_index];
+ }
+ else {
+ *r_uv = MEM_callocN(sizeof(**r_uv) * num_uv_layers, "Particle UVs");
+ }
+ }
+ else {
*r_uv = MEM_callocN(sizeof(**r_uv) * num_uv_layers, "Particle UVs");
}
if (child_index == -1) {