diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_library_remap.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle_system.c | 4 |
3 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/blenkernel/BKE_library_remap.h b/source/blender/blenkernel/BKE_library_remap.h index e974b79ee66..89b087014b2 100644 --- a/source/blender/blenkernel/BKE_library_remap.h +++ b/source/blender/blenkernel/BKE_library_remap.h @@ -44,7 +44,7 @@ enum { * (like e.g. Object->data). */ ID_REMAP_FLAG_NEVER_NULL_USAGE = 1 << 2, /* This tells the callback func to force setting IDs using target one with a 'never NULL' pointer to NULL. - * WARNING! Use with extreme care, this will leave database in broken state! */ + * WARNING! Use with extreme care, this will leave database in broken state and can cause crashes very easily! */ ID_REMAP_FORCE_NEVER_NULL_USAGE = 1 << 3, }; diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 907721b09b6..1ea27558545 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -503,7 +503,9 @@ void psys_free_particles(ParticleSystem *psys) PARTICLE_P; if (psys->particles) { - if (psys->part->type == PART_HAIR) { + /* Even though psys->part should never be NULL, this can happen as an exception during deletion. + * See ID_REMAP_SKIP/FORCE/FLAG_NEVER_NULL_USAGE in BKE_library_remap. */ + if (psys->part && psys->part->type == PART_HAIR) { LOOP_PARTICLES { if (pa->hair) MEM_freeN(pa->hair); diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index b4e951ce04a..efaf1f9df2b 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -4336,7 +4336,9 @@ void BKE_particlesystem_id_loop(ParticleSystem *psys, ParticleSystemIDFunc func, func(psys, (ID **)&pt->ob, userdata, IDWALK_NOP); } - if (psys->part->phystype == PART_PHYS_BOIDS) { + /* Even though psys->part should never be NULL, this can happen as an exception during deletion. + * See ID_REMAP_SKIP/FORCE/FLAG_NEVER_NULL_USAGE in BKE_library_remap. */ + if (psys->part && psys->part->phystype == PART_PHYS_BOIDS) { ParticleData *pa; int p; |