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/blenkernel/intern/paint.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/blenkernel/intern/paint.c')
-rw-r--r-- | source/blender/blenkernel/intern/paint.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index 74542321a62..e8829c6216b 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -51,6 +51,7 @@ #include "BKE_global.h" #include "BKE_image.h" #include "BKE_library.h" +#include "BKE_object.h" #include "BKE_paint.h" #include "BKE_pbvh.h" #include "BKE_subsurf.h" @@ -433,11 +434,8 @@ void sculptsession_bm_to_me_for_render(Object *object) * here because this will lead to the while object * surface to disappear, so we'll release DM in place. */ - if (object->derivedFinal) { - object->derivedFinal->needsFree = 1; - object->derivedFinal->release(object->derivedFinal); - object->derivedFinal = NULL; - } + BKE_object_free_derived_caches(object); + if (object->sculpt->pbvh) { BKE_pbvh_free(object->sculpt->pbvh); object->sculpt->pbvh = NULL; |