Fix T55015: Crash on selection after recent BVH changes
Runtime data should always be initialized to NULL on read-time.
This commit is contained in:
@@ -192,7 +192,7 @@ void BKE_mesh_mselect_active_set(struct Mesh *me, int index, int type);
|
|||||||
void BKE_mesh_apply_vert_coords(struct Mesh *mesh, float (*vertCoords)[3]);
|
void BKE_mesh_apply_vert_coords(struct Mesh *mesh, float (*vertCoords)[3]);
|
||||||
|
|
||||||
/* *** mesh_runtime.c *** */
|
/* *** mesh_runtime.c *** */
|
||||||
|
void BKE_mesh_runtime_reset(struct Mesh *mesh);
|
||||||
int BKE_mesh_runtime_looptri_len(const struct Mesh *mesh);
|
int BKE_mesh_runtime_looptri_len(const struct Mesh *mesh);
|
||||||
void BKE_mesh_runtime_looptri_recalc(struct Mesh *mesh);
|
void BKE_mesh_runtime_looptri_recalc(struct Mesh *mesh);
|
||||||
const struct MLoopTri *BKE_mesh_runtime_looptri_ensure(struct Mesh *mesh);
|
const struct MLoopTri *BKE_mesh_runtime_looptri_ensure(struct Mesh *mesh);
|
||||||
|
@@ -44,6 +44,13 @@
|
|||||||
|
|
||||||
static ThreadRWMutex loops_cache_lock = PTHREAD_RWLOCK_INITIALIZER;
|
static ThreadRWMutex loops_cache_lock = PTHREAD_RWLOCK_INITIALIZER;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default values defined at read time.
|
||||||
|
*/
|
||||||
|
void BKE_mesh_runtime_reset(Mesh *mesh)
|
||||||
|
{
|
||||||
|
memset(&mesh->runtime, 0, sizeof(mesh->runtime));
|
||||||
|
}
|
||||||
|
|
||||||
/* This is a ported copy of DM_ensure_looptri_data(dm) */
|
/* This is a ported copy of DM_ensure_looptri_data(dm) */
|
||||||
/**
|
/**
|
||||||
|
@@ -4685,7 +4685,7 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh)
|
|||||||
|
|
||||||
mesh->bb = NULL;
|
mesh->bb = NULL;
|
||||||
mesh->edit_btmesh = NULL;
|
mesh->edit_btmesh = NULL;
|
||||||
mesh->runtime.batch_cache = NULL;
|
BKE_mesh_runtime_reset(mesh);
|
||||||
|
|
||||||
/* happens with old files */
|
/* happens with old files */
|
||||||
if (mesh->mselect == NULL) {
|
if (mesh->mselect == NULL) {
|
||||||
|
Reference in New Issue
Block a user