From bfb2f2e9e1ad254098c712eb7951273b9c997dce Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Mon, 17 Sep 2018 10:25:45 -0700 Subject: [PATCH] fix node.remove(), update next node pointer --- src/server/channel.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/server/channel.rs b/src/server/channel.rs index 193c8e6e..89fd55b4 100644 --- a/src/server/channel.rs +++ b/src/server/channel.rs @@ -226,12 +226,15 @@ impl Node { fn remove(&mut self) { unsafe { self.element = ptr::null_mut(); - let next = self.next.take(); + let mut next = self.next.take(); let mut prev = self.prev.take(); if let Some(ref mut prev) = prev { prev.as_mut().unwrap().next = next; } + if let Some(ref mut next) = next { + next.as_mut().unwrap().prev = prev; + } } } }