Fix Buttons context, invalid object data access

Another instance of T44376.
Crash where the Python context would access a stale pointer to the active object.
This commit is contained in:
2015-05-04 18:02:56 +10:00
parent c9e5e81064
commit 74dc4e87a6
7 changed files with 47 additions and 68 deletions

View File

@@ -808,25 +808,11 @@ void BKE_object_unlink(Object *ob)
}
}
}
else if (sl->spacetype == SPACE_OUTLINER) {
#if 0
else if (ELEM(sl->spacetype, SPACE_OUTLINER, SPACE_BUTS, SPACE_NODE)) {
/* now handled by WM_main_remove_editor_id_reference */
}
else if (sl->spacetype == SPACE_BUTS) {
SpaceButs *sbuts = (SpaceButs *)sl;
if (sbuts->pinid == (ID *)ob) {
sbuts->flag &= ~SB_PIN_CONTEXT;
sbuts->pinid = NULL;
}
}
else if (sl->spacetype == SPACE_NODE) {
SpaceNode *snode = (SpaceNode *)sl;
if (snode->from == (ID *)ob) {
snode->flag &= ~SNODE_PIN;
snode->from = NULL;
}
}
#endif
}
sa = sa->next;