Fix T67002: Crash redoing an action after ID rename

This commit is contained in:
Campbell Barton 2019-07-16 15:53:15 +10:00
parent fdf2d8728a
commit d5fa230736
Notes: blender-bot 2023-02-14 01:48:10 +01:00
Referenced by issue #67002, In Edit mode of almost any object, performing operation -> rename object -> change value from redo panel -> crash the Blender 2.8
1 changed files with 11 additions and 3 deletions

View File

@ -758,9 +758,17 @@ static void ui_apply_but_undo(uiBut *but)
/* Optionally override undo when undo system doesn't support storing properties. */
if (but->rnapoin.id.data) {
ID *id = but->rnapoin.id.data;
if (!ED_undo_is_legacy_compatible_for_property(but->block->evil_C, id)) {
str = "";
/* Exception for renaming ID data, we always need undo pushes in this case,
* because undo systems track data by their ID, see: T67002. */
extern PropertyRNA rna_ID_name;
if (but->rnaprop == &rna_ID_name) {
/* pass */
}
else {
ID *id = but->rnapoin.id.data;
if (!ED_undo_is_legacy_compatible_for_property(but->block->evil_C, id)) {
str = "";
}
}
}