WIP : Use an extra step of indirection in accessing CustomDataLayers via rna. #108319

Open
Martijn Versteegh wants to merge 3 commits from Baardaap/blender:fix_dangling_customdata_pointers into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
1 changed files with 2 additions and 0 deletions
Showing only changes of commit 2ad8de628b - Show all commits

View File

@ -3120,6 +3120,7 @@ bool CustomData_free_layer(CustomData *data,
}
BLI_assert(data->layers[index].type == type);
data->layer_locator[data->layers[index].this_locator] = nullptr;
customData_free_layer__internal(&data->layers[index], totelem);
for (int i = index + 1; i < data->totlayer; i++) {
@ -3253,6 +3254,7 @@ void CustomData_free_temporary(CustomData *data, const int totelem)
}
if ((layer->flag & CD_FLAG_TEMPORARY) == CD_FLAG_TEMPORARY) {
data->layer_locator[layer->this_locator] = nullptr;
customData_free_layer__internal(layer, totelem);
changed = true;
}