Fix bug in last commit.

This commit is contained in:
Joseph Eagar 2021-05-11 21:45:43 -07:00
parent b8a8e4f9b1
commit fa06238aa7
1 changed files with 5 additions and 4 deletions

View File

@ -608,6 +608,11 @@ static void SCULPT_dynamic_topology_disable_ex(
/* Clear data. */
me->flag &= ~ME_SCULPT_DYNAMIC_TOPOLOGY;
if (ss->bm_log) {
BM_log_free(ss->bm_log, true);
ss->bm_log = NULL;
}
/* Typically valid but with global-undo they can be NULL, see: T36234. */
if (ss->bm) {
// rebuild ss->persistent_base if necassary
@ -616,10 +621,6 @@ static void SCULPT_dynamic_topology_disable_ex(
BM_mesh_free(ss->bm);
ss->bm = NULL;
}
if (ss->bm_log) {
BM_log_free(ss->bm_log, true);
ss->bm_log = NULL;
}
BKE_particlesystem_reset_all(ob);
BKE_ptcache_object_reset(scene, ob, PTCACHE_RESET_OUTDATED);