diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-05-18 14:24:34 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-05-18 14:24:34 +0400 |
commit | 11186184aa7af143e72c539be0ed06c3ef37a146 (patch) | |
tree | 9be7e1160f0bcf9484526068327e99f237907b41 /source/blender/editors/mesh/editmesh_utils.c | |
parent | 8da43c5aaf5a0628da8f1523cc902ab82bdd5e20 (diff) |
Fix #35404: crash in file save with python code that accesses mesh from panel.
On file save the mesh gets loads from the editmesh but the derived mesh caches
wer not cleared. This usually happens through the depsgraph but it needs to be
done manually here. Most changes are some refactoring to deduplicate derived
mesh freeing code.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_utils.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_utils.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c index 719c7ab95e3..40fda072180 100644 --- a/source/blender/editors/mesh/editmesh_utils.c +++ b/source/blender/editors/mesh/editmesh_utils.c @@ -374,6 +374,11 @@ void EDBM_mesh_load(Object *ob) #ifdef USE_TESSFACE_DEFAULT BKE_mesh_tessface_calc(me); #endif + + /* free derived mesh. usually this would happen through depsgraph but there + * are exceptions like file save that will not cause this, and we want to + * avoid ending up with an invalid derived mesh then */ + BKE_object_free_derived_caches(ob); } /** |