Fix: Crash when writing mesh after previous commit

Runtime data was accessed after it was explicitly set to null.
This commit is contained in:
2022-11-18 16:24:15 -06:00
parent 1ea169d90e
commit 05f93b58d3

View File

@@ -228,7 +228,6 @@ static void mesh_blend_write(BlendWriter *writer, ID *id, const void *id_address
mesh->mface = nullptr;
mesh->totface = 0;
memset(&mesh->fdata, 0, sizeof(mesh->fdata));
mesh->runtime = nullptr;
/* Do not store actual geometry data in case this is a library override ID. */
if (ID_IS_OVERRIDE_LIBRARY(mesh) && !is_undo) {
@@ -277,6 +276,8 @@ static void mesh_blend_write(BlendWriter *writer, ID *id, const void *id_address
CustomData_blend_write_prepare(mesh->pdata, poly_layers, names_to_skip);
}
mesh->runtime = nullptr;
BLO_write_id_struct(writer, Mesh, id_address, &mesh->id);
BKE_id_blend_write(writer, &mesh->id);