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:
authorBastien Montagne <montagne29@wanadoo.fr>2016-09-15 12:50:56 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-09-15 12:50:56 +0300
commita8ed9144a38980cb4e9a28af70b3b3b34a48e92f (patch)
treee6c2fbb94599fbdd48b9ffb076fdfeee7e3c2882 /source/blender/blenkernel/intern/particle.c
parenta2a5ae5b54713d59287aebf189428270feddbb23 (diff)
Fix crash in some cases when deleting particle systems.
Those 'never null' ID pointers are really a PITA to handle... luckily we don't have much of those around! Found by Sybren, thanks. Should be backported to 2.78.
Diffstat (limited to 'source/blender/blenkernel/intern/particle.c')
-rw-r--r--source/blender/blenkernel/intern/particle.c4
1 files changed, 3 insertions, 1 deletions
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);