From 841885189f9e831a8d95ec40d5073b36c2a1bc2d Mon Sep 17 00:00:00 2001 From: pzg8616235 <1164064820@qq.com> Date: Mon, 20 Apr 2020 17:05:35 +0800 Subject: [PATCH] Update chatroom.go --- WebIM/controllers/chatroom.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/WebIM/controllers/chatroom.go b/WebIM/controllers/chatroom.go index 0bb3042..7c80cc0 100644 --- a/WebIM/controllers/chatroom.go +++ b/WebIM/controllers/chatroom.go @@ -72,8 +72,10 @@ func chatroom() { } case event := <-publish: // Notify waiting list. - for ch := waitingList.Back(); ch != nil; ch = ch.Prev() { + var n *list.Element + for ch := waitingList.Back(); ch != nil; ch = n { ch.Value.(chan bool) <- true + n = ch.Prev() waitingList.Remove(ch) }