Merge branch 'master' of /home/opensim/var/repo/opensim

integration
BlueWall 2012-07-23 14:52:35 -04:00
commit 8d815872b9
2 changed files with 18 additions and 5 deletions

View File

@ -99,8 +99,13 @@ namespace OpenSim.Framework
} }
else else
{ {
item = oldHeadNext.Item; item = oldHeadNext.Item;
haveAdvancedHead = CAS(ref head, oldHead, oldHeadNext); haveAdvancedHead = CAS(ref head, oldHead, oldHeadNext);
if (haveAdvancedHead)
{
oldHeadNext.Item = default(T);
oldHead.Next = null;
}
} }
} }
} }
@ -111,6 +116,10 @@ namespace OpenSim.Framework
public void Clear() public void Clear()
{ {
// ugly
T item;
while(count > 0)
Dequeue(out item);
Init(); Init();
} }

View File

@ -63,12 +63,15 @@ namespace OpenSim.Framework
internal void Clear() internal void Clear()
{ {
this.value = default(T);
if (this.handle != null) if (this.handle != null)
{
this.handle.Clear(); this.handle.Clear();
this.handle = null; ClearRef();
} }
internal void ClearRef()
{
this.value = default(T);
this.handle = null;
} }
} }
@ -285,6 +288,7 @@ namespace OpenSim.Framework
if (--this.size > 0 && index != this.size) if (--this.size > 0 && index != this.size)
{ {
Set(this.items[this.size], index); Set(this.items[this.size], index);
this.items[this.size].ClearRef();
if (!BubbleUp(index)) if (!BubbleUp(index))
BubbleDown(index); BubbleDown(index);
} }