Committing Avination's memleak fix-a-thon, installment #2
Ensure items coming off the lockless queue are released. Also ensure this is done when the queue is cleared.0.7.4.1
parent
7d16d0664e
commit
55c1c10c0d
|
@ -101,6 +101,11 @@ namespace OpenSim.Framework
|
|||
{
|
||||
item = oldHeadNext.Item;
|
||||
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()
|
||||
{
|
||||
// ugly
|
||||
T item;
|
||||
while(count > 0)
|
||||
Dequeue(out item);
|
||||
Init();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue