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:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-11-30 03:46:42 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-11-30 03:46:42 +0300
commit4c31bed6b462db32bf2c2eabf6af932428a65f25 (patch)
tree41627fd41da0a813914ad4141bef11d48bdd8636 /source/blender/depsgraph
parent7ec5a68091a8ed3eb066fca832eb26a3692ea654 (diff)
Fix T57981: Crash entering sculpt mode
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r--source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc23
1 files changed, 21 insertions, 2 deletions
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
index 636b270fe83..89d3740c43e 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
@@ -131,7 +131,6 @@ void nested_id_hack_discard_pointers(ID *id_cow)
SPECIAL_CASE(ID_LS, FreestyleLineStyle, nodetree)
SPECIAL_CASE(ID_LA, Lamp, nodetree)
SPECIAL_CASE(ID_MA, Material, nodetree)
- SPECIAL_CASE(ID_SCE, Scene, nodetree)
SPECIAL_CASE(ID_TE, Tex, nodetree)
SPECIAL_CASE(ID_WO, World, nodetree)
@@ -139,6 +138,17 @@ void nested_id_hack_discard_pointers(ID *id_cow)
SPECIAL_CASE(ID_LT, Lattice, key)
SPECIAL_CASE(ID_ME, Mesh, key)
+ case ID_SCE:
+ {
+ Scene *scene_cow = (Scene *)id_cow;
+ /* Node trees always have their own ID node in the graph, and are
+ * being copied as part of their copy-on-write process. */
+ scene_cow->nodetree = NULL;
+ /* Tool settings pointer is shared with the original scene. */
+ scene_cow->toolsettings = NULL;
+ break;
+ }
+
case ID_OB:
{
/* Clear the ParticleSettings pointer to prevent doubly-freeing it. */
@@ -174,7 +184,6 @@ const ID *nested_id_hack_get_discarded_pointers(NestedIDHackTempStorage *storage
SPECIAL_CASE(ID_LS, FreestyleLineStyle, nodetree, linestyle)
SPECIAL_CASE(ID_LA, Lamp, nodetree, lamp)
SPECIAL_CASE(ID_MA, Material, nodetree, material)
- SPECIAL_CASE(ID_SCE, Scene, nodetree, scene)
SPECIAL_CASE(ID_TE, Tex, nodetree, tex)
SPECIAL_CASE(ID_WO, World, nodetree, world)
@@ -182,6 +191,14 @@ const ID *nested_id_hack_get_discarded_pointers(NestedIDHackTempStorage *storage
SPECIAL_CASE(ID_LT, Lattice, key, lattice)
SPECIAL_CASE(ID_ME, Mesh, key, mesh)
+ case ID_SCE:
+ {
+ storage->scene = *(Scene *)id;
+ storage->scene.toolsettings = NULL;
+ storage->scene.nodetree = NULL;
+ return &storage->scene.id;
+ }
+
# undef SPECIAL_CASE
default:
@@ -629,6 +646,7 @@ void update_special_pointers(const Depsgraph *depsgraph,
{
Scene *scene_cow = (Scene *)id_cow;
const Scene *scene_orig = (const Scene *)id_orig;
+ scene_cow->toolsettings = scene_orig->toolsettings;
scene_cow->eevee.light_cache = scene_orig->eevee.light_cache;
break;
}
@@ -1003,6 +1021,7 @@ void discard_mesh_edit_mode_pointers(ID *id_cow)
void discard_scene_pointers(ID *id_cow)
{
Scene *scene_cow = (Scene *)id_cow;
+ scene_cow->toolsettings = NULL;
scene_cow->eevee.light_cache = NULL;
}