fixup race on ch.reqChan 23/18423/1
authorNicolas PLANEL <nplanel@redhat.com>
Wed, 20 Mar 2019 13:14:10 +0000 (14:14 +0100)
committerNicolas PLANEL <nplanel@redhat.com>
Wed, 20 Mar 2019 13:23:02 +0000 (14:23 +0100)
git.fd.io/govpp.git/core/request_handler.go:37
git.fd.io/govpp.git/core/channel.go:188

Change-Id: I5be8be5e3ca105822ea4bb3b9690938634950d78
Signed-off-by: Nicolas PLANEL <nplanel@redhat.com>
core/channel.go

index 6cb02f7..2e73917 100644 (file)
@@ -184,10 +184,7 @@ func (ch *Channel) SetReplyTimeout(timeout time.Duration) {
 }
 
 func (ch *Channel) Close() {
-       if ch.reqChan != nil {
-               close(ch.reqChan)
-               ch.reqChan = nil
-       }
+       close(ch.reqChan)
 }
 
 func (req *requestCtx) ReceiveReply(msg api.Message) error {