diff options
author | UbitUmarov | 2012-03-12 07:50:14 +0000 |
---|---|---|
committer | UbitUmarov | 2012-03-12 07:50:14 +0000 |
commit | a35e00e81eba1d3b0990c9c8139d77d34d6cbb7e (patch) | |
tree | 06b13744ac40862a835cd43e69cc0a9e39a4bd8a /OpenSim/Region/Framework | |
parent | ubitode prim select was not doing phantom case (diff) | |
download | opensim-SC_OLD-a35e00e81eba1d3b0990c9c8139d77d34d6cbb7e.zip opensim-SC_OLD-a35e00e81eba1d3b0990c9c8139d77d34d6cbb7e.tar.gz opensim-SC_OLD-a35e00e81eba1d3b0990c9c8139d77d34d6cbb7e.tar.bz2 opensim-SC_OLD-a35e00e81eba1d3b0990c9c8139d77d34d6cbb7e.tar.xz |
allocate UndoRedoStore only on demand
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index a17862e..94e4560 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -263,7 +263,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
263 | private bool m_occupied; // KF if any av is sitting on this prim | 263 | private bool m_occupied; // KF if any av is sitting on this prim |
264 | private string m_text = String.Empty; | 264 | private string m_text = String.Empty; |
265 | private string m_touchName = String.Empty; | 265 | private string m_touchName = String.Empty; |
266 | private UndoRedoState m_UndoRedo = new UndoRedoState(5); | 266 | private UndoRedoState m_UndoRedo = null; |
267 | 267 | ||
268 | private bool m_passTouches; | 268 | private bool m_passTouches; |
269 | 269 | ||
@@ -1706,7 +1706,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1706 | dupe.Category = Category; | 1706 | dupe.Category = Category; |
1707 | dupe.m_rezzed = m_rezzed; | 1707 | dupe.m_rezzed = m_rezzed; |
1708 | 1708 | ||
1709 | dupe.m_UndoRedo = new UndoRedoState(5); | 1709 | dupe.m_UndoRedo = null; |
1710 | 1710 | ||
1711 | dupe.IgnoreUndoUpdate = false; | 1711 | dupe.IgnoreUndoUpdate = false; |
1712 | dupe.Undoing = false; | 1712 | dupe.Undoing = false; |
@@ -3646,6 +3646,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
3646 | 3646 | ||
3647 | public void StoreUndoState(ObjectChangeWhat what) | 3647 | public void StoreUndoState(ObjectChangeWhat what) |
3648 | { | 3648 | { |
3649 | if (m_UndoRedo == null) | ||
3650 | m_UndoRedo = new UndoRedoState(5); | ||
3651 | |||
3649 | lock (m_UndoRedo) | 3652 | lock (m_UndoRedo) |
3650 | { | 3653 | { |
3651 | if (!Undoing && !IgnoreUndoUpdate && ParentGroup != null) // just to read better - undo is in progress, or suspended | 3654 | if (!Undoing && !IgnoreUndoUpdate && ParentGroup != null) // just to read better - undo is in progress, or suspended |
@@ -3662,18 +3665,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
3662 | { | 3665 | { |
3663 | get | 3666 | get |
3664 | { | 3667 | { |
3665 | lock (m_UndoRedo) | 3668 | if (m_UndoRedo == null) |
3666 | return m_UndoRedo.Count; | 3669 | return 0; |
3670 | return m_UndoRedo.Count; | ||
3667 | } | 3671 | } |
3668 | } | 3672 | } |
3669 | 3673 | ||
3670 | public void Undo() | 3674 | public void Undo() |
3671 | { | 3675 | { |
3676 | if (m_UndoRedo == null || Undoing || ParentGroup == null) | ||
3677 | return; | ||
3678 | |||
3672 | lock (m_UndoRedo) | 3679 | lock (m_UndoRedo) |
3673 | { | 3680 | { |
3674 | if (Undoing || ParentGroup == null) | ||
3675 | return; | ||
3676 | |||
3677 | Undoing = true; | 3681 | Undoing = true; |
3678 | m_UndoRedo.Undo(this); | 3682 | m_UndoRedo.Undo(this); |
3679 | Undoing = false; | 3683 | Undoing = false; |
@@ -3682,11 +3686,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
3682 | 3686 | ||
3683 | public void Redo() | 3687 | public void Redo() |
3684 | { | 3688 | { |
3689 | if (m_UndoRedo == null || Undoing || ParentGroup == null) | ||
3690 | return; | ||
3691 | |||
3685 | lock (m_UndoRedo) | 3692 | lock (m_UndoRedo) |
3686 | { | 3693 | { |
3687 | if (Undoing || ParentGroup == null) | ||
3688 | return; | ||
3689 | |||
3690 | Undoing = true; | 3694 | Undoing = true; |
3691 | m_UndoRedo.Redo(this); | 3695 | m_UndoRedo.Redo(this); |
3692 | Undoing = false; | 3696 | Undoing = false; |
@@ -3695,6 +3699,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
3695 | 3699 | ||
3696 | public void ClearUndoState() | 3700 | public void ClearUndoState() |
3697 | { | 3701 | { |
3702 | if (m_UndoRedo == null || Undoing) | ||
3703 | return; | ||
3704 | |||
3698 | lock (m_UndoRedo) | 3705 | lock (m_UndoRedo) |
3699 | { | 3706 | { |
3700 | m_UndoRedo.Clear(); | 3707 | m_UndoRedo.Clear(); |