@ Fixed a race condition in Undo/Redo storage system

This commit is contained in:
codeimp 2009-02-22 09:45:35 +00:00
parent 4e064d78cd
commit 29b797b4f3

View file

@ -374,9 +374,16 @@ namespace CodeImp.DoomBuilder.Editing
// Reset grouping
lastgroup = UndoGroup.None;
// Change map set
if(u.IsOnDisk) { u.StoreOnDisk = false; u.RestoreFromFile(); }
General.Map.ChangeMapSet(new MapSet(u.MapData));
lock(u)
{
// Change map set
if(u.IsOnDisk)
{
u.StoreOnDisk = false;
u.RestoreFromFile();
}
General.Map.ChangeMapSet(new MapSet(u.MapData));
}
// Remove selection
General.Map.Map.ClearAllMarks(false);
@ -448,9 +455,16 @@ namespace CodeImp.DoomBuilder.Editing
// Reset grouping
lastgroup = UndoGroup.None;
// Change map set
if(r.IsOnDisk) { r.StoreOnDisk = false; r.RestoreFromFile(); }
General.Map.ChangeMapSet(new MapSet(r.MapData));
lock(r)
{
// Change map set
if(r.IsOnDisk)
{
r.StoreOnDisk = false;
r.RestoreFromFile();
}
General.Map.ChangeMapSet(new MapSet(r.MapData));
}
// Remove selection
General.Map.Map.ClearAllMarks(false);