Fix T58046: Crash when changing Particle type, when Hair has dynamics
authorPhilipp Oeser <info@graphics-engineer.com>
Fri, 7 Dec 2018 08:49:28 +0000 (09:49 +0100)
committerPhilipp Oeser <info@graphics-engineer.com>
Fri, 7 Dec 2018 09:54:44 +0000 (10:54 +0100)
thx @sergey for checking

source/blender/blenkernel/intern/particle.c

index 8a1134e0c80db6c1041c3c5248999b84ba5013e9..f86fe271a9f0e7640a0d598a345365b7c0010eac 100644 (file)
@@ -469,6 +469,7 @@ void free_hair(Object *object, ParticleSystem *psys, int dynamics)
        if (psys->clmd) {
                if (dynamics) {
                        modifier_free((ModifierData *)psys->clmd);
+                       psys->clmd = NULL;
                        PTCacheID pid;
                        BKE_ptcache_id_from_particles(&pid, object, psys);
                        BKE_ptcache_id_clear(&pid, PTCACHE_CLEAR_ALL, 0);