diff options
author | Janne Karhu <jhkarh@gmail.com> | 2011-01-15 15:29:22 +0300 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2011-01-15 15:29:22 +0300 |
commit | 4cb79661eb4b69b66a5c5c980790db360c7d7332 (patch) | |
tree | b90bf42ae21d072811ce6945996e0a7d477aa25d /source/blender/editors/space_view3d | |
parent | 7297169a7491c85e9bdb9d9c80aaa54fce587232 (diff) |
Fix for [#25633] Particles display switching causes crash when Velocity disp. ON
* Particle draw data wasn't freed properly in some cases.
* Velocity + circle draw type also crashed due to missing null pointer check.
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 26445c4d742..8724f2f9def 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -3684,6 +3684,11 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv pdd->nd= pdd->ndata; pdd->tot_vec_size= tot_vec_size; } + else if(psys->pdd) { + psys_free_pdd(psys); + MEM_freeN(psys->pdd); + pdd = psys->pdd = NULL; + } if(pdd) { pdd->ma_r = &ma_r; @@ -3842,7 +3847,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv if(drawn) { /* additional things to draw for each particle */ /* (velocity, size and number) */ - if((part->draw & PART_DRAW_VEL) && pdd->vedata){ + if((part->draw & PART_DRAW_VEL) && pdd && pdd->vedata){ copy_v3_v3(pdd->ved,state.co); pdd->ved += 3; mul_v3_v3fl(vel, state.vel, timestep); |