Page MenuHome

Crash undoing object rename in edit mode
Closed, ResolvedPublic


System Information
Operating system: Win10
Graphics card: GeforceGTX950

Blender Version
2.80, dc3b5024be1a4, 2019-01-23, win64

Blender sometimes crashs by pressing Ctrl+Z directly after a mesh renamed (in my case Cube.001)


Event Timeline

Brecht Van Lommel (brecht) triaged this task as Confirmed, Medium priority.Jan 24 2019, 7:32 AM


Enter edit mode on default cube, rename cube object, then press Ctrl+Z.

Brecht Van Lommel (brecht) renamed this task from Blender sometimes crashs by pressing Ctrl+Z directly after renaming a mesh to Crash undoing object rename in edit mode.Jan 24 2019, 7:32 AM

This fixes the problem. But I'm not sure whether meshedit_undo should be handling this in the first place.

diff --git a/source/blender/blenkernel/intern/undo_system.c b/source/blender/blenkernel/intern/undo_system.c
index 12cd8fc43e9..c2a814128af 100644
--- a/source/blender/blenkernel/intern/undo_system.c
+++ b/source/blender/blenkernel/intern/undo_system.c
@@ -126,8 +126,6 @@ static void undosys_id_ref_store(void *UNUSED(user_data), UndoRefID *id_ref)
 	BLI_assert(id_ref->name[0] == '\0');
 	if (id_ref->ptr) {
 		BLI_strncpy(id_ref->name, id_ref->ptr->name, sizeof(id_ref->name));
-		/* Not needed, just prevents stale data access. */
-		id_ref->ptr = NULL;

@matc (matc), this only works in the simple case, it wont work if a memfile undo step as been loaded.

On Friday I looked into possible fixes for this:

Some options are:

  • Add memfile undo pushes when renaming.
  • Use something besides the name (eg, a UUID) for each ID instead of it's name.
  • Use memfile undo for all modes and optimize it to remove the need for different undo systems (see: T56163).

I'll try some solutions this week in a branch and post any updates here.