Fix (unreported) crash when ungrouping a nodegroup with some animated node.

Was accessing already freed action in temp nodegroup animation data...
This commit is contained in:
Bastien Montagne 2016-02-20 13:15:40 +01:00
parent 028c67c81e
commit 8132553553
Notes: blender-bot 2023-02-14 08:13:36 +01:00
Referenced by issue #47428, Deleting keyframe in node group makes a zombie action data block when the node had an action
1 changed files with 2 additions and 1 deletions

View File

@ -253,7 +253,7 @@ static int node_group_ungroup(bNodeTree *ntree, bNode *gnode)
if (wgroup->adt) {
LinkData *ld, *ldn = NULL;
bAction *waction;
/* firstly, wgroup needs to temporary dummy action that can be destroyed, as it shares copies */
waction = wgroup->adt->action = BKE_action_copy(wgroup->adt->action);
@ -271,6 +271,7 @@ static int node_group_ungroup(bNodeTree *ntree, bNode *gnode)
/* free temp action too */
if (waction) {
BKE_libblock_free(G.main, waction);
wgroup->adt->action = NULL;
}
}