[Bf-blender-cvs] [d5fa2307363] master: Fix T67002: Crash redoing an action after ID rename

Campbell Barton noreply at git.blender.org
Tue Jul 16 08:11:00 CEST 2019


Commit: d5fa23073634b15873b13c1f242234340685beb7
Author: Campbell Barton
Date:   Tue Jul 16 15:53:15 2019 +1000
Branches: master
https://developer.blender.org/rBd5fa23073634b15873b13c1f242234340685beb7

Fix T67002: Crash redoing an action after ID rename

===================================================================

M	source/blender/editors/interface/interface_handlers.c

===================================================================

diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 0666f0e491e..a7fc0cfec25 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -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 = "";
+        }
       }
     }



More information about the Bf-blender-cvs mailing list