Fix: action's actual users and recorded user count could diverge

The user count decrement and unassigning the action were split
between two different conditionals, which weren't guaranteed
to both execute/not-execute together.
This commit is contained in:
Nathan Vegdahl
2023-06-01 15:04:19 +02:00
parent 98d48c16a3
commit 355f4164b6

View File

@@ -137,14 +137,13 @@ bool BKE_animdata_set_action(ReportList *reports, ID *id, bAction *act)
return false;
}
/* Reduce user-count for current action. */
/* Unassign current action. */
if (adt->action) {
id_us_min((ID *)adt->action);
adt->action = NULL;
}
if (act == NULL) {
/* Just clearing the action. */
adt->action = NULL;
return true;
}