From ab45444a27bd80ca2db77da8e1b082e2be0bdd60 Mon Sep 17 00:00:00 2001 From: shamork Date: Thu, 17 Mar 2016 11:24:18 +0800 Subject: [PATCH] Update memtopics.go writing smu and rmu should get lock --- topics/memtopics.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/topics/memtopics.go b/topics/memtopics.go index 3cddfa9..d316e88 100644 --- a/topics/memtopics.go +++ b/topics/memtopics.go @@ -125,8 +125,12 @@ func (this *memTopics) Retained(topic []byte, msgs *[]*message.PublishMessage) e } func (this *memTopics) Close() error { + this.smu.Lock() this.sroot = nil + this.smu.Unlock() + this.rmu.Lock() this.rroot = nil + this.rmu.Unlock() return nil }