diff options
author | Melanie | 2012-07-11 04:01:20 +0200 |
---|---|---|
committer | Melanie | 2012-07-11 04:01:20 +0200 |
commit | ac3a2296fa6de7ad07f862fbe073e9e3495677f1 (patch) | |
tree | ba1df16bb3079983ca25e5f1b0532eff81159c66 /OpenSim/Framework/MinHeap.cs | |
parent | Melanie fix: detach SOGs from backup on linking (diff) | |
download | opensim-SC-ac3a2296fa6de7ad07f862fbe073e9e3495677f1.zip opensim-SC-ac3a2296fa6de7ad07f862fbe073e9e3495677f1.tar.gz opensim-SC-ac3a2296fa6de7ad07f862fbe073e9e3495677f1.tar.bz2 opensim-SC-ac3a2296fa6de7ad07f862fbe073e9e3495677f1.tar.xz |
Make sure handles stay intact when removing from the MinHeap
Diffstat (limited to 'OpenSim/Framework/MinHeap.cs')
-rw-r--r-- | OpenSim/Framework/MinHeap.cs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/OpenSim/Framework/MinHeap.cs b/OpenSim/Framework/MinHeap.cs index f2218c9..99ac25d 100644 --- a/OpenSim/Framework/MinHeap.cs +++ b/OpenSim/Framework/MinHeap.cs | |||
@@ -63,12 +63,15 @@ namespace OpenSim.Framework | |||
63 | 63 | ||
64 | internal void Clear() | 64 | internal void Clear() |
65 | { | 65 | { |
66 | this.value = default(T); | ||
67 | if (this.handle != null) | 66 | if (this.handle != null) |
68 | { | ||
69 | this.handle.Clear(); | 67 | this.handle.Clear(); |
70 | this.handle = null; | 68 | ClearRef(); |
71 | } | 69 | } |
70 | |||
71 | internal void ClearRef() | ||
72 | { | ||
73 | this.value = default(T); | ||
74 | this.handle = null; | ||
72 | } | 75 | } |
73 | } | 76 | } |
74 | 77 | ||
@@ -285,7 +288,7 @@ namespace OpenSim.Framework | |||
285 | if (--this.size > 0 && index != this.size) | 288 | if (--this.size > 0 && index != this.size) |
286 | { | 289 | { |
287 | Set(this.items[this.size], index); | 290 | Set(this.items[this.size], index); |
288 | this.items[this.size].Clear(); | 291 | this.items[this.size].ClearRef(); |
289 | if (!BubbleUp(index)) | 292 | if (!BubbleUp(index)) |
290 | BubbleDown(index); | 293 | BubbleDown(index); |
291 | } | 294 | } |