summaryrefslogtreecommitdiffhomepage
path: root/pkg/refs
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/refs')
-rwxr-xr-xpkg/refs/weak_ref_list.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/pkg/refs/weak_ref_list.go b/pkg/refs/weak_ref_list.go
index 19daf9ab0..1d0ae2099 100755
--- a/pkg/refs/weak_ref_list.go
+++ b/pkg/refs/weak_ref_list.go
@@ -135,8 +135,9 @@ func (l *weakRefList) InsertBefore(a, e *WeakRef) {
// Remove removes e from l.
func (l *weakRefList) Remove(e *WeakRef) {
- prev := weakRefElementMapper{}.linkerFor(e).Prev()
- next := weakRefElementMapper{}.linkerFor(e).Next()
+ linker := weakRefElementMapper{}.linkerFor(e)
+ prev := linker.Prev()
+ next := linker.Next()
if prev != nil {
weakRefElementMapper{}.linkerFor(prev).SetNext(next)
@@ -149,6 +150,9 @@ func (l *weakRefList) Remove(e *WeakRef) {
} else {
l.tail = prev
}
+
+ linker.SetNext(nil)
+ linker.SetPrev(nil)
}
// Entry is a default implementation of Linker. Users can add anonymous fields