diff options
author | Hans Goudey <h.goudey@me.com> | 2021-07-02 07:03:09 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-07-02 07:03:27 +0300 |
commit | 9f5c0ffb5ec293af2e4f003c2178d21e20805b47 (patch) | |
tree | eb5b5c98fae3402da6ad98472ad5f5ea1cfbacd0 /source/blender/editors/mesh | |
parent | 016a2707f573efe113f89ced1870912de19a16a1 (diff) |
Cleanup: Use const variables for object's evaluated mesh
Generally the evaluated mesh should not be changed, since that is the
job of the modifier stack. Current code is far from const correct in
that regard. This commit uses a const variable for the reult of
`BKE_object_get_evaluated_mesh` in some cases. The most common
remaining case is retrieving a BVH tree from the mesh.
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r-- | source/blender/editors/mesh/editmesh_knife_project.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/mesh/editmesh_knife_project.c b/source/blender/editors/mesh/editmesh_knife_project.c index aa144dd3f3c..942fe143787 100644 --- a/source/blender/editors/mesh/editmesh_knife_project.c +++ b/source/blender/editors/mesh/editmesh_knife_project.c @@ -59,7 +59,7 @@ static LinkNode *knifeproject_poly_from_object(const bContext *C, { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); ARegion *region = CTX_wm_region(C); - struct Mesh *me_eval; + const struct Mesh *me_eval; bool me_eval_needs_free; if (ob->type == OB_MESH || ob->runtime.data_eval) { @@ -113,7 +113,7 @@ static LinkNode *knifeproject_poly_from_object(const bContext *C, BKE_nurbList_free(&nurbslist); if (me_eval_needs_free) { - BKE_mesh_free(me_eval); + BKE_mesh_free((struct Mesh *)me_eval); } } |