Fix T99661: Use after free converting edit mode curve object to mesh
The fix from c0fdf16561
was missing in one place. We don't
want to free the edit mode pointers, those are just copied because the
edit mode changes aren't present in the actual original data-block.
This commit is contained in:
parent
79f1cc601c
commit
31e06a8c73
Notes:
blender-bot
2023-02-14 00:37:17 +01:00
Referenced by issue #99661, Regression: Converting curve object to mesh makes object disappear from 3D view
|
@ -985,6 +985,12 @@ static Mesh *mesh_new_from_curve_type_object(const Object *object)
|
|||
|
||||
/* If evaluating the curve replaced object data with different data, free the original data. */
|
||||
if (temp_data != temp_object->data) {
|
||||
if (GS(temp_data->name) == ID_CU_LEGACY) {
|
||||
/* Clear edit mode pointers that were explicitly copied to the temporary curve. */
|
||||
Curve *curve = reinterpret_cast<Curve *>(temp_data);
|
||||
curve->editfont = nullptr;
|
||||
curve->editnurb = nullptr;
|
||||
}
|
||||
BKE_id_free(nullptr, temp_data);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue