From 3e3a884c4d8e87e8a26d416042733804f4213728 Mon Sep 17 00:00:00 2001 From: crusader Date: Thu, 30 Nov 2017 16:09:09 +0900 Subject: [PATCH] ing --- servlet.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/servlet.go b/servlet.go index 4e370b0..1f3bfce 100644 --- a/servlet.go +++ b/servlet.go @@ -85,14 +85,13 @@ func (s *rpcServlet) Stop() { panic("Server: server must be started before stopping it") } - s.sh.Destroy(s.ctx) - close(s.stopChan) s.stopWg.Wait() + + s.sh.Destroy(s.ctx) + s.stopChan = nil - s.responseQueueChan = nil - s.conn = nil s.serverCodec = nil @@ -123,9 +122,9 @@ func handleServlet(s *rpcServlet) { logging.Logger().Info(fmt.Sprintf("Servlet is started")) defer func() { - s.doneChan <- err s.stopWg.Done() s.Stop() + s.doneChan <- err }() subStopChan := make(chan struct{})