Fix T75156: Cast modifier crash in edit-mode

Add NULL checks to other deform modifiers too.
This commit is contained in:
Campbell Barton 2020-03-29 16:08:22 +11:00
parent a24f52c51c
commit ac02c702e5
Notes: blender-bot 2023-02-13 23:02:35 +01:00
Referenced by issue #75282, bug in the edit mode preview
Referenced by issue #75156, Cast Modifier crashes upon entering Edit Mode
5 changed files with 6 additions and 6 deletions

View File

@ -234,7 +234,7 @@ static void deformMatrices(ModifierData *md,
amd->defgrp_name,
NULL);
if (mesh_src != mesh) {
if (!ELEM(mesh_src, NULL, mesh)) {
BKE_id_free(NULL, mesh_src);
}
}

View File

@ -513,7 +513,7 @@ static void deformVertsEM(ModifierData *md,
sphere_do(cmd, ctx, ctx->object, mesh_src, vertexCos, numVerts);
}
if (mesh_src != mesh) {
if (!ELEM(mesh_src, NULL, mesh)) {
BKE_id_free(NULL, mesh_src);
}
}

View File

@ -231,7 +231,7 @@ static void deformVerts(ModifierData *md,
}
}
if (mesh_src != mesh) {
if (!ELEM(mesh_src, NULL, mesh)) {
BKE_id_free(NULL, mesh_src);
}
}

View File

@ -740,7 +740,7 @@ static void deformVerts(ModifierData *md,
correctivesmooth_modifier_do(
md, ctx->depsgraph, ctx->object, mesh_src, vertexCos, (uint)numVerts, NULL);
if (mesh_src != mesh) {
if (!ELEM(mesh_src, NULL, mesh)) {
BKE_id_free(NULL, mesh_src);
}
}
@ -758,7 +758,7 @@ static void deformVertsEM(ModifierData *md,
correctivesmooth_modifier_do(
md, ctx->depsgraph, ctx->object, mesh_src, vertexCos, (uint)numVerts, editData);
if (mesh_src != mesh) {
if (!ELEM(mesh_src, NULL, mesh)) {
BKE_id_free(NULL, mesh_src);
}
}

View File

@ -189,7 +189,7 @@ static void deformVerts(ModifierData *md,
BKE_mesh_tessface_ensure(psmd->mesh_original);
}
if (mesh_src != psmd->mesh_final && mesh_src != mesh) {
if (!ELEM(mesh_src, NULL, mesh, psmd->mesh_final)) {
BKE_id_free(NULL, mesh_src);
}