Fix T39758: Blender Crash when removing pinned Scene.

This commit is contained in:
Bastien Montagne 2014-04-17 10:48:32 +02:00
parent bd3231c760
commit 88ae0be1c4
Notes: blender-bot 2024-01-16 18:05:25 +01:00
Referenced by issue #39758, Blender Crash when removing pinned Scene
1 changed files with 13 additions and 2 deletions

View File

@ -743,6 +743,13 @@ static void scene_unlink_space_node(SpaceNode *snode, Scene *sce)
}
}
static void scene_unlink_space_buts(SpaceButs *sbuts, Scene *sce)
{
if (sbuts->pinid == &sce->id) {
sbuts->pinid = NULL;
}
}
void BKE_scene_unlink(Main *bmain, Scene *sce, Scene *newsce)
{
Scene *sce1;
@ -775,8 +782,12 @@ void BKE_scene_unlink(Main *bmain, Scene *sce, Scene *newsce)
for (area = screen->areabase.first; area; area = area->next) {
SpaceLink *space_link;
for (space_link = area->spacedata.first; space_link; space_link = space_link->next) {
if (space_link->spacetype == SPACE_NODE)
scene_unlink_space_node((SpaceNode *)space_link, sce);
switch (space_link->spacetype) {
case SPACE_NODE:
scene_unlink_space_node((SpaceNode *)space_link, sce);
case SPACE_BUTS:
scene_unlink_space_buts((SpaceButs *)space_link, sce);
}
}
}
}