fix for [#11136] Segmentation fault when copying objects with hairs
authorCampbell Barton <ideasman42@gmail.com>
Sun, 11 May 2008 11:34:39 +0000 (11:34 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 11 May 2008 11:34:39 +0000 (11:34 +0000)
source/blender/blenkernel/intern/object.c
source/blender/makesdna/DNA_particle_types.h

index 5594a1dfaf7f2d6671dbf84696bfce04f8c1d190..a2a7894e3ce024af8f219327ce5abcb4bcd641af 100644 (file)
@@ -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);
index baf8de62b7f7a3e2a7b69ddab6f0cb5eb1a9e442..4f62cd084cc9b0ca0095635d1ab4d3276ea15bb5 100644 (file)
@@ -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 */