diff options
Diffstat (limited to 'source/blender/blenkernel/intern/customdata.cc')
-rw-r--r-- | source/blender/blenkernel/intern/customdata.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/customdata.cc b/source/blender/blenkernel/intern/customdata.cc index e1bc025efd2..5e3beab9b72 100644 --- a/source/blender/blenkernel/intern/customdata.cc +++ b/source/blender/blenkernel/intern/customdata.cc @@ -2209,7 +2209,9 @@ void CustomData_realloc(CustomData *data, int totelem) continue; } typeInfo = layerType_getInfo(layer->type); - layer->data = MEM_reallocN(layer->data, (size_t)totelem * typeInfo->size); + /* Use calloc to avoid the need to manually initialize new data in layers. + * Useful for types like #MDeformVert which contain a pointer. */ + layer->data = MEM_recallocN(layer->data, (size_t)totelem * typeInfo->size); } } |