Merge branch 'master' into blender2.8

This commit is contained in:
Bastien Montagne 2018-05-08 14:22:46 +02:00
commit b857b8f4c4
10 changed files with 22 additions and 32 deletions

View File

@ -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;

View File

@ -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)
{

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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))

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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);
}
}

View File

@ -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) {

View File

@ -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);