Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYimingWu <xp8110@outlook.com>2020-06-04 13:57:28 +0300
committerYimingWu <xp8110@outlook.com>2020-06-04 13:57:28 +0300
commitbfbf0bb7f7a0191b65fc724d5dfea225e6293c6b (patch)
tree042f37d28c9e1cf0ce5a0fb4fd4235288f62d36e /source/blender/blenkernel/intern/mesh_runtime.c
parent3b52dfe549f0c2fca7e0cd499b85fb098e9b4da9 (diff)
parent78017916f7c7a8ec8907c9b993214ff8ec3c3557 (diff)
Merge remote-tracking branch 'origin/master' into temp-lanpr-reviewtemp-lanpr-review
# Conflicts: # release/datafiles/locale # release/scripts/addons
Diffstat (limited to 'source/blender/blenkernel/intern/mesh_runtime.c')
-rw-r--r--source/blender/blenkernel/intern/mesh_runtime.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/mesh_runtime.c b/source/blender/blenkernel/intern/mesh_runtime.c
index aa3586d1e3d..8bce577897b 100644
--- a/source/blender/blenkernel/intern/mesh_runtime.c
+++ b/source/blender/blenkernel/intern/mesh_runtime.c
@@ -53,6 +53,7 @@ void BKE_mesh_runtime_reset(Mesh *mesh)
memset(&mesh->runtime, 0, sizeof(mesh->runtime));
mesh->runtime.eval_mutex = MEM_mallocN(sizeof(ThreadMutex), "mesh runtime eval_mutex");
BLI_mutex_init(mesh->runtime.eval_mutex);
+ mesh->runtime.bvh_cache = NULL;
}
/* Clear all pointers which we don't want to be shared on copying the datablock.
@@ -227,7 +228,10 @@ bool BKE_mesh_runtime_clear_edit_data(Mesh *mesh)
void BKE_mesh_runtime_clear_geometry(Mesh *mesh)
{
- bvhcache_free(&mesh->runtime.bvh_cache);
+ if (mesh->runtime.bvh_cache) {
+ bvhcache_free(mesh->runtime.bvh_cache);
+ mesh->runtime.bvh_cache = NULL;
+ }
MEM_SAFE_FREE(mesh->runtime.looptris.array);
/* TODO(sergey): Does this really belong here? */
if (mesh->runtime.subdiv_ccg != NULL) {