diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-05-08 15:22:46 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-05-08 15:22:46 +0300 |
commit | b857b8f4c441ba40c7848f176ba750c4a4b093cb (patch) | |
tree | d30bae4794e659fccd1b2bd64e6b2cea2ded3048 /source/blender/modifiers | |
parent | cc8672b95ec61c3292dc0f07620808a4b9b0a373 (diff) | |
parent | 49fe27ee46b4d9272957c21c13365db322ca8396 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r-- | source/blender/modifiers/intern/MOD_collision.c | 2 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_explode.c | 2 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_fluidsim.c | 7 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_fluidsim_util.c | 4 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_hook.c | 9 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_ocean.c | 2 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_subsurf.c | 2 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_surface.c | 15 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_surfacedeform.c | 7 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_warp.c | 4 |
10 files changed, 22 insertions, 32 deletions
diff --git a/source/blender/modifiers/intern/MOD_collision.c b/source/blender/modifiers/intern/MOD_collision.c index c8c00e31845..d80a2121db6 100644 --- a/source/blender/modifiers/intern/MOD_collision.c +++ b/source/blender/modifiers/intern/MOD_collision.c @@ -69,7 +69,7 @@ static void freeData(ModifierData *md) { CollisionModifierData *collmd = (CollisionModifierData *) md; - if (collmd) { + if (collmd) { /* Seriously? */ if (collmd->bvhtree) { BLI_bvhtree_free(collmd->bvhtree); collmd->bvhtree = NULL; diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c index 329d1cc49ef..52139238502 100644 --- a/source/blender/modifiers/intern/MOD_explode.c +++ b/source/blender/modifiers/intern/MOD_explode.c @@ -66,7 +66,7 @@ static void freeData(ModifierData *md) { ExplodeModifierData *emd = (ExplodeModifierData *) md; - if (emd->facepa) MEM_freeN(emd->facepa); + MEM_SAFE_FREE(emd->facepa); } static void copyData(ModifierData *md, ModifierData *target) { diff --git a/source/blender/modifiers/intern/MOD_fluidsim.c b/source/blender/modifiers/intern/MOD_fluidsim.c index 7014861bc12..90cd8a58cb1 100644 --- a/source/blender/modifiers/intern/MOD_fluidsim.c +++ b/source/blender/modifiers/intern/MOD_fluidsim.c @@ -70,14 +70,17 @@ static void copyData(ModifierData *md, ModifierData *target) FluidsimModifierData *fluidmd = (FluidsimModifierData *) md; FluidsimModifierData *tfluidmd = (FluidsimModifierData *) target; - fluidsim_free(tfluidmd); - if (fluidmd->fss) { tfluidmd->fss = MEM_dupallocN(fluidmd->fss); if (tfluidmd->fss && (tfluidmd->fss->meshVelocities != NULL)) { tfluidmd->fss->meshVelocities = MEM_dupallocN(tfluidmd->fss->meshVelocities); } } + + /* Seems to never be used, but for sqke of consistency... */ + BLI_assert(fluidmd->point_cache == NULL); + BLI_assert(tfluidmd->point_cache == NULL); + tfluidmd->point_cache = NULL; } diff --git a/source/blender/modifiers/intern/MOD_fluidsim_util.c b/source/blender/modifiers/intern/MOD_fluidsim_util.c index 72c44121e0b..07d0b48fdb4 100644 --- a/source/blender/modifiers/intern/MOD_fluidsim_util.c +++ b/source/blender/modifiers/intern/MOD_fluidsim_util.c @@ -155,6 +155,10 @@ void fluidsim_free(FluidsimModifierData *fluidmd) } MEM_SAFE_FREE(fluidmd->fss); } + + /* Seems to never be used, but for sqke of consistency... */ + BLI_assert(fluidmd->point_cache == NULL); + fluidmd->point_cache = NULL; return; } diff --git a/source/blender/modifiers/intern/MOD_hook.c b/source/blender/modifiers/intern/MOD_hook.c index 7e7d43cdf20..ff2ed7108f2 100644 --- a/source/blender/modifiers/intern/MOD_hook.c +++ b/source/blender/modifiers/intern/MOD_hook.c @@ -65,13 +65,6 @@ static void copyData(ModifierData *md, ModifierData *target) HookModifierData *hmd = (HookModifierData *) md; HookModifierData *thmd = (HookModifierData *) target; - if (thmd->curfalloff != NULL) { - curvemapping_free(thmd->curfalloff); - } - if (thmd->indexar != NULL) { - MEM_freeN(thmd->indexar); - } - modifier_copyData_generic(md, target); thmd->curfalloff = curvemapping_copy(hmd->curfalloff); @@ -97,7 +90,7 @@ static void freeData(ModifierData *md) curvemapping_free(hmd->curfalloff); - if (hmd->indexar) MEM_freeN(hmd->indexar); + MEM_SAFE_FREE(hmd->indexar); } static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams)) diff --git a/source/blender/modifiers/intern/MOD_ocean.c b/source/blender/modifiers/intern/MOD_ocean.c index bff12a55558..e589620b211 100644 --- a/source/blender/modifiers/intern/MOD_ocean.c +++ b/source/blender/modifiers/intern/MOD_ocean.c @@ -167,8 +167,6 @@ static void copyData(ModifierData *md, ModifierData *target) #endif OceanModifierData *tomd = (OceanModifierData *) target; - freeData(target); - modifier_copyData_generic(md, target); tomd->refresh = 0; diff --git a/source/blender/modifiers/intern/MOD_subsurf.c b/source/blender/modifiers/intern/MOD_subsurf.c index aea3aee8655..c23030b6374 100644 --- a/source/blender/modifiers/intern/MOD_subsurf.c +++ b/source/blender/modifiers/intern/MOD_subsurf.c @@ -84,9 +84,11 @@ static void freeData(ModifierData *md) if (smd->mCache) { ccgSubSurf_free(smd->mCache); + smd->mCache = NULL; } if (smd->emCache) { ccgSubSurf_free(smd->emCache); + smd->emCache = NULL; } } diff --git a/source/blender/modifiers/intern/MOD_surface.c b/source/blender/modifiers/intern/MOD_surface.c index 752b81a5f10..d1ff6ff9573 100644 --- a/source/blender/modifiers/intern/MOD_surface.c +++ b/source/blender/modifiers/intern/MOD_surface.c @@ -63,20 +63,17 @@ static void freeData(ModifierData *md) if (surmd) { if (surmd->bvhtree) { free_bvhtree_from_mesh(surmd->bvhtree); - MEM_freeN(surmd->bvhtree); + MEM_SAFE_FREE(surmd->bvhtree); } - if (surmd->dm) + if (surmd->dm) { surmd->dm->release(surmd->dm); + surmd->dm = NULL; + } - if (surmd->x) - MEM_freeN(surmd->x); + MEM_SAFE_FREE(surmd->x); - if (surmd->v) - MEM_freeN(surmd->v); - - surmd->bvhtree = NULL; - surmd->dm = NULL; + MEM_SAFE_FREE(surmd->v); } } diff --git a/source/blender/modifiers/intern/MOD_surfacedeform.c b/source/blender/modifiers/intern/MOD_surfacedeform.c index bedce88326e..f262fa99db1 100644 --- a/source/blender/modifiers/intern/MOD_surfacedeform.c +++ b/source/blender/modifiers/intern/MOD_surfacedeform.c @@ -124,12 +124,11 @@ static void freeData(ModifierData *md) MEM_SAFE_FREE(smd->verts[i].binds[j].vert_weights); } - MEM_freeN(smd->verts[i].binds); + MEM_SAFE_FREE(smd->verts[i].binds); } } - MEM_freeN(smd->verts); - smd->verts = NULL; + MEM_SAFE_FREE(smd->verts); } } @@ -138,8 +137,6 @@ static void copyData(ModifierData *md, ModifierData *target) SurfaceDeformModifierData *smd = (SurfaceDeformModifierData *)md; SurfaceDeformModifierData *tsmd = (SurfaceDeformModifierData *)target; - freeData(target); - modifier_copyData_generic(md, target); if (smd->verts) { diff --git a/source/blender/modifiers/intern/MOD_warp.c b/source/blender/modifiers/intern/MOD_warp.c index f4ec7686a22..b991ab721d8 100644 --- a/source/blender/modifiers/intern/MOD_warp.c +++ b/source/blender/modifiers/intern/MOD_warp.c @@ -64,10 +64,6 @@ static void copyData(ModifierData *md, ModifierData *target) WarpModifierData *wmd = (WarpModifierData *) md; WarpModifierData *twmd = (WarpModifierData *) target; - if (twmd->curfalloff != NULL) { - curvemapping_free(twmd->curfalloff); - } - modifier_copyData_generic(md, target); twmd->curfalloff = curvemapping_copy(wmd->curfalloff); |