diff options
author | Janne Karhu <jhkarh@gmail.com> | 2009-12-26 03:17:54 +0300 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2009-12-26 03:17:54 +0300 |
commit | 7a19832a78bea88d0a9c64809ef6e6576e870456 (patch) | |
tree | 30e1bbf08a4ee26e7100b21e3d05dc6fde400863 /source/blender/blenkernel/intern/particle_system.c | |
parent | 266271d65a5aaeb0040848a2e288695b3e9ed7c9 (diff) |
Fix for [#20294] Switching to particle mode after changing number of hair particles causes blender to crash.
* Particle edit mode wasn't freed when the particle amount was changed.
Diffstat (limited to 'source/blender/blenkernel/intern/particle_system.c')
-rw-r--r-- | source/blender/blenkernel/intern/particle_system.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 9882bfea137..d3dacadca53 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -170,6 +170,12 @@ static void realloc_particles(ParticleSimulationData *sim, int new_totpart) PARTICLE_P; int totpart, totsaved = 0; + if(psys->edit && psys->free_edit) { + psys->free_edit(psys->edit); + psys->edit = NULL; + psys->free_edit = NULL; + } + if(new_totpart<0) { if(part->distr==PART_DISTR_GRID && part->from != PART_FROM_VERT) { totpart= part->grid_res; |