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:
authorCampbell Barton <ideasman42@gmail.com>2021-08-06 06:59:38 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-08-06 07:24:16 +0300
commitbc97d7832906318a1185b3fb460b1d8d89020ba0 (patch)
tree096969472b2a5ad82c56d8f616cd398f47840bdf /source/blender/blenkernel/intern/particle_system.c
parent99738fbfdc8b4639d95c796bcc8711bd89c1aaa4 (diff)
Cleanup: use MEM_SAFE_FREE macro
Diffstat (limited to 'source/blender/blenkernel/intern/particle_system.c')
-rw-r--r--source/blender/blenkernel/intern/particle_system.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 9c0c5639777..f592b0f97ea 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -169,10 +169,7 @@ void psys_reset(ParticleSystem *psys, int mode)
}
/* reset children */
- if (psys->child) {
- MEM_freeN(psys->child);
- psys->child = NULL;
- }
+ MEM_SAFE_FREE(psys->child);
psys->totchild = 0;
@@ -182,10 +179,7 @@ void psys_reset(ParticleSystem *psys, int mode)
/* reset point cache */
BKE_ptcache_invalidate(psys->pointcache);
- if (psys->fluid_springs) {
- MEM_freeN(psys->fluid_springs);
- psys->fluid_springs = NULL;
- }
+ MEM_SAFE_FREE(psys->fluid_springs);
psys->tot_fluidsprings = psys->alloc_fluidsprings = 0;
}
@@ -4516,10 +4510,7 @@ static void system_step(ParticleSimulationData *sim, float cfra, const bool use_
reset_all_particles(sim, 0.0, cfra, oldtotpart);
free_unexisting_particles(sim);
- if (psys->fluid_springs) {
- MEM_freeN(psys->fluid_springs);
- psys->fluid_springs = NULL;
- }
+ MEM_SAFE_FREE(psys->fluid_springs);
psys->tot_fluidsprings = psys->alloc_fluidsprings = 0;