Fix T42525 crash when deleting lamp attached to Lamp Data material node

in material shading mode.
This commit is contained in:
2014-11-06 16:38:31 +01:00
parent a081a4817c
commit 0c28aaae7e

View File

@@ -435,6 +435,8 @@ void BKE_object_unlink(Object *ob)
Scene *sce;
SceneRenderLayer *srl;
FreestyleLineSet *lineset;
bNodeTree *ntree;
bNode *node;
Curve *cu;
Tex *tex;
Group *group;
@@ -811,6 +813,15 @@ void BKE_object_unlink(Object *ob)
}
camera = camera->id.next;
}
/* nodes */
for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next) {
for (node = ntree->nodes.first; node; node = node->next) {
if (node->id == &ob->id) {
node->id = NULL;
}
}
}
}
/* actual check for internal data, not context or flags */