Add some locking on m_undo in SceneObjectPart

0.6.0-stable
Melanie Thielker 2008-08-17 19:17:44 +00:00
parent 5d6a42a22e
commit fe1d78bb78
1 changed files with 25 additions and 15 deletions

View File

@ -1176,8 +1176,11 @@ namespace OpenSim.Region.Environment.Scenes
} }
public void ClearUndoState() public void ClearUndoState()
{
lock(m_undo)
{ {
m_undo.Clear(); m_undo.Clear();
}
StoreUndoState(); StoreUndoState();
} }
@ -2445,6 +2448,8 @@ namespace OpenSim.Region.Environment.Scenes
if (!Undoing) if (!Undoing)
{ {
if (m_parentGroup != null) if (m_parentGroup != null)
{
lock(m_undo)
{ {
if (m_undo.Count > 0) if (m_undo.Count > 0)
{ {
@ -2457,11 +2462,13 @@ namespace OpenSim.Region.Environment.Scenes
} }
if (m_parentGroup.GetSceneMaxUndo() > 0) if (m_parentGroup.GetSceneMaxUndo() > 0)
{ {
UndoState nUndo = new UndoState(this); UndoState nUndo = new UndoState(this);
m_undo.Push(nUndo); m_undo.Push(nUndo);
}
} }
} }
@ -2950,6 +2957,8 @@ namespace OpenSim.Region.Environment.Scenes
} }
public void Undo() public void Undo()
{
lock(m_undo)
{ {
if (m_undo.Count > 0) if (m_undo.Count > 0)
{ {
@ -2958,6 +2967,7 @@ namespace OpenSim.Region.Environment.Scenes
goback.PlaybackState(this); goback.PlaybackState(this);
} }
} }
}
public void UpdateExtraParam(ushort type, bool inUse, byte[] data) public void UpdateExtraParam(ushort type, bool inUse, byte[] data)
{ {