diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2015-01-08 14:40:27 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2015-01-20 11:30:09 +0300 |
commit | b292d783f28958a54f608375e6e99a92be5522d6 (patch) | |
tree | 0a243224369edb837843d9514fdd20fd834b89ef /source/blender/blenkernel/intern/particle_distribute.c | |
parent | 1727a165dd165d2ce392e7a31691db19fb093a5f (diff) |
Separate context freeing from task freeing in threaded particle updates
to prevent double-freeing/invalid mem access.
This can happen with the "virtual parents" feature, which generates both
parent and child paths. Each task free function also freed the shared
context, leading to double freeing.
Diffstat (limited to 'source/blender/blenkernel/intern/particle_distribute.c')
-rw-r--r-- | source/blender/blenkernel/intern/particle_distribute.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/particle_distribute.c b/source/blender/blenkernel/intern/particle_distribute.c index 90338e96945..7a422abae47 100644 --- a/source/blender/blenkernel/intern/particle_distribute.c +++ b/source/blender/blenkernel/intern/particle_distribute.c @@ -1140,6 +1140,8 @@ static void distribute_particles_on_dm(ParticleSimulationData *sim, int from) ctx.dm->release(ctx.dm); psys_tasks_free(tasks, numtasks); + + psys_thread_context_free(&ctx); } /* ready for future use, to emit particles without geometry */ |