From a2528b412393eaa158b0d7756925d93d0c1050ea Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 11 May 2008 11:34:39 +0000 Subject: [PATCH] fix for [#11136] Segmentation fault when copying objects with hairs --- source/blender/blenkernel/intern/object.c | 6 +++++- source/blender/makesdna/DNA_particle_types.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 5594a1dfaf7..a2a7894e3ce 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1054,7 +1054,11 @@ ParticleSystem *copy_particlesystem(ParticleSystem *psys) psysn->childcache= NULL; psysn->edit= NULL; psysn->effectors.first= psysn->effectors.last= 0; - + + psysn->pathcachebufs.first = psysn->pathcachebufs.last = NULL; + psysn->reactevents.first = psysn->reactevents.last = NULL; + psysn->renderdata = NULL; + psysn->pointcache= BKE_ptcache_copy(psys->pointcache); id_us_plus((ID *)psysn->part); diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h index baf8de62b7f..4f62cd084cc 100644 --- a/source/blender/makesdna/DNA_particle_types.h +++ b/source/blender/makesdna/DNA_particle_types.h @@ -168,7 +168,7 @@ typedef struct ParticleSettings { struct PartDeflect *pd; } ParticleSettings; -typedef struct ParticleSystem{ +typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in copy_particlesystem */ struct ParticleSystem *next, *prev; ParticleSettings *part; /* particle settings */