models/server: fix bug, program will core if listener is nil

This commit is contained in:
fatedier 2016-03-14 00:39:32 +08:00
parent 975c2a97c8
commit 3218eda481
1 changed files with 3 additions and 1 deletions

View File

@ -128,7 +128,9 @@ func (p *ProxyServer) Start() (err error) {
func (p *ProxyServer) Close() {
p.Lock()
p.Status = consts.Idle
if p.listener != nil {
p.listener.Close()
}
close(p.ctlMsgChan)
close(p.cliConnChan)
p.userConnList = list.New()