Default cube reappears after having been deleted when editing vert count of new mesh circle
Open, ConfirmedPublic

Description

System Information
Windows 10 & Ubuntu 18.04
nvidia gtx 1050ti

Blender Version
Broken: 2.79 2461be1
Worked: 2.79 f28aec1

Short description of error
Deleted default cube reappears if I make a mesh circle and change the number of vertices. Or, if I modify the default cube and then create a circle, when I adjust the number of verts in the operator properties panel, blender immediately crashes.

Exact steps for others to reproduce the error

(I Have in user preferences: 'enter edit mode' checked)

(I have 'default' screen layout on main screen and just a node editor in a secondary window on another monitor.)

Delete the default cube.

Create a mesh circle.

Use the operator properties panel to change the number of vertices.

Default cube should reappear.

Details

Type
Bug
Philipp Oeser (lichtwerk) triaged this task as Confirmed priority.Thu, Jun 14, 11:36 AM

This doesnt happen if you use Global Undo, so only the combination of Enter Editmode ON and Global Undo OFF

Caused by rB9636cab0098f

Crash (modifying default cube, objectmode, create mesh circle, adjust number of verts) traceback:
(MeshUndoStep->obedit_ref.ptr->data->edit_btmesh is NULL causing trouble in undomesh_to_editmesh)

1  undomesh_to_editmesh               editmesh_undo.c      549   0x1c7abd4 
2  mesh_undosys_step_decode           editmesh_undo.c      770   0x1c7cce5 
3  undosys_step_decode                undo_system.c        174   0x2781f67 
4  BKE_undosys_step_undo_with_data_ex undo_system.c        538   0x27834d2 
5  BKE_undosys_step_undo_with_data    undo_system.c        553   0x2783606 
6  BKE_undosys_step_undo_with_data_ex undo_system.c        544   0x27835cb 
7  BKE_undosys_step_undo_with_data    undo_system.c        553   0x2783606 
8  ed_undo_step                       ed_undo.c            126   0x187a2d8 
9  ED_undo_pop_op                     ed_undo.c            189   0x187a4b5 
10 ED_undo_operator_repeat            ed_undo.c            344   0x187a9cf 
11 ED_undo_operator_repeat_cb_evt     ed_undo.c            390   0x187ab84

Still didnt find time to study UNDO in more depth, so passing this on to @Campbell Barton (campbellbarton)...