Fixed a bug that sometimes caused a crash on undo

This commit is contained in:
codeimp 2009-06-19 07:59:38 +00:00
parent 442bf3c278
commit d45b61f041

View file

@ -97,12 +97,6 @@ namespace CodeImp.DoomBuilder.Map
// Already set isdisposed so that changes can be prohibited // Already set isdisposed so that changes can be prohibited
isdisposed = true; isdisposed = true;
if(map == General.Map.Map)
General.Map.UndoRedo.RecRemVertex(this);
// Remove from main list
map.RemoveVertex(listindex);
if(map.AutoRemove) if(map.AutoRemove)
{ {
// Dispose the lines that are attached to this vertex // Dispose the lines that are attached to this vertex
@ -115,6 +109,12 @@ namespace CodeImp.DoomBuilder.Map
foreach(Linedef ld in linedefs) ld.DetachVertexP(this); foreach(Linedef ld in linedefs) ld.DetachVertexP(this);
} }
if(map == General.Map.Map)
General.Map.UndoRedo.RecRemVertex(this);
// Remove from main list
map.RemoveVertex(listindex);
// Clean up // Clean up
linedefs = null; linedefs = null;
map = null; map = null;