diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-04-30 15:35:47 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-04-30 15:38:40 +0300 |
commit | 6cf28e98fbbd7e92ea4d2bc28009b3d108ddb1a1 (patch) | |
tree | f9136bfea57e4a3c0682291ee3e85ed2e8ee20db /source/blender/blenkernel/intern | |
parent | 31828449145c23f72a67cd7d15c9c81c22b160cd (diff) |
Object: rename BKE_object_runtime_free, leave data cleared
Rename BKE_object_runtime_free -> BKE_object_runtime_free_data,
since the runtime pointer is part of the object, only the data is freed.
Leave the data cleared to avoid accidental use,
this is in keeping with other `*_free_data()` functions.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/mesh_convert.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 7 |
2 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/mesh_convert.c b/source/blender/blenkernel/intern/mesh_convert.c index e03a5f03fb5..5892dc49fd6 100644 --- a/source/blender/blenkernel/intern/mesh_convert.c +++ b/source/blender/blenkernel/intern/mesh_convert.c @@ -1116,9 +1116,9 @@ static void curve_to_mesh_eval_ensure(Object *object) BKE_object_eval_assign_data(&remapped_object, &mesh_eval->id, true); } - BKE_object_runtime_free(&remapped_object); - BKE_object_runtime_free(&taper_object); - BKE_object_runtime_free(&taper_object); + BKE_object_runtime_free_data(&remapped_object); + BKE_object_runtime_free_data(&taper_object); + BKE_object_runtime_free_data(&taper_object); } static Mesh *mesh_new_from_curve_type_object(Object *object) diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 912bd5a4d69..02be16d1d28 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -5116,12 +5116,15 @@ void BKE_object_runtime_reset_on_copy(Object *object, const int UNUSED(flag)) /** * The function frees memory used by the runtime data, but not the runtime field itself. * - * The caller is expected to run #BKE_object_runtime_reset if the struct will be used again. + * All runtime data is cleared to ensure it's not used again, + * in keeping with other `_free_data(..)` functions. */ -void BKE_object_runtime_free(Object *object) +void BKE_object_runtime_free_data(Object *object) { /* Currently this is all that's needed. */ BKE_object_free_derived_caches(object); + + BKE_object_runtime_reset(object); } /** |