@ 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

@ -373,11 +373,18 @@ namespace CodeImp.DoomBuilder.Editing
// Reset grouping // Reset grouping
lastgroup = UndoGroup.None; 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 // Remove selection
General.Map.Map.ClearAllMarks(false); General.Map.Map.ClearAllMarks(false);
General.Map.Map.ClearAllSelected(); General.Map.Map.ClearAllSelected();
@ -448,10 +455,17 @@ namespace CodeImp.DoomBuilder.Editing
// Reset grouping // Reset grouping
lastgroup = UndoGroup.None; lastgroup = UndoGroup.None;
// Change map set lock(r)
if(r.IsOnDisk) { r.StoreOnDisk = false; r.RestoreFromFile(); } {
General.Map.ChangeMapSet(new MapSet(r.MapData)); // Change map set
if(r.IsOnDisk)
{
r.StoreOnDisk = false;
r.RestoreFromFile();
}
General.Map.ChangeMapSet(new MapSet(r.MapData));
}
// Remove selection // Remove selection
General.Map.Map.ClearAllMarks(false); General.Map.Map.ClearAllMarks(false);
General.Map.Map.ClearAllSelected(); General.Map.Map.ClearAllSelected();