diff options
author | UbitUmarov | 2012-07-11 06:43:03 +0100 |
---|---|---|
committer | UbitUmarov | 2012-07-11 06:43:03 +0100 |
commit | bb78b327c0c36b515f0e60e2783961e9325062da (patch) | |
tree | 42995d49e06b3ac80382ffc9e9d324cde05f3922 /OpenSim/Framework | |
parent | Merge branch 'avination' into ubitwork (diff) | |
download | opensim-SC-bb78b327c0c36b515f0e60e2783961e9325062da.zip opensim-SC-bb78b327c0c36b515f0e60e2783961e9325062da.tar.gz opensim-SC-bb78b327c0c36b515f0e60e2783961e9325062da.tar.bz2 opensim-SC-bb78b327c0c36b515f0e60e2783961e9325062da.tar.xz |
stop keeping references to objects on released items
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/LocklessQueue.cs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/OpenSim/Framework/LocklessQueue.cs b/OpenSim/Framework/LocklessQueue.cs index dd3d201..84f887c 100644 --- a/OpenSim/Framework/LocklessQueue.cs +++ b/OpenSim/Framework/LocklessQueue.cs | |||
@@ -99,8 +99,13 @@ namespace OpenSim.Framework | |||
99 | } | 99 | } |
100 | else | 100 | else |
101 | { | 101 | { |
102 | item = oldHeadNext.Item; | 102 | item = oldHeadNext.Item; |
103 | haveAdvancedHead = CAS(ref head, oldHead, oldHeadNext); | 103 | haveAdvancedHead = CAS(ref head, oldHead, oldHeadNext); |
104 | if (haveAdvancedHead) | ||
105 | { | ||
106 | oldHeadNext.Item = default(T); | ||
107 | oldHead.Next = null; | ||
108 | } | ||
104 | } | 109 | } |
105 | } | 110 | } |
106 | } | 111 | } |
@@ -111,6 +116,10 @@ namespace OpenSim.Framework | |||
111 | 116 | ||
112 | public void Clear() | 117 | public void Clear() |
113 | { | 118 | { |
119 | // ugly | ||
120 | T item; | ||
121 | while(count > 0) | ||
122 | Dequeue(out item); | ||
114 | Init(); | 123 | Init(); |
115 | } | 124 | } |
116 | 125 | ||