修复崩溃的bug
This commit is contained in:
parent
1eb4a917fe
commit
003682366c
@ -298,11 +298,18 @@ func (ctl *Control) worker() {
|
|||||||
case <-ctl.closedCh:
|
case <-ctl.closedCh:
|
||||||
// close related channels and wait until other goroutines done
|
// close related channels and wait until other goroutines done
|
||||||
close(ctl.readCh)
|
close(ctl.readCh)
|
||||||
|
if ctl.readerShutdown != nil {
|
||||||
ctl.readerShutdown.WaitDone()
|
ctl.readerShutdown.WaitDone()
|
||||||
|
}
|
||||||
|
|
||||||
|
if ctl.msgHandlerShutdown != nil {
|
||||||
ctl.msgHandlerShutdown.WaitDone()
|
ctl.msgHandlerShutdown.WaitDone()
|
||||||
|
}
|
||||||
|
|
||||||
close(ctl.sendCh)
|
close(ctl.sendCh)
|
||||||
|
if ctl.writerShutdown != nil {
|
||||||
ctl.writerShutdown.WaitDone()
|
ctl.writerShutdown.WaitDone()
|
||||||
|
}
|
||||||
|
|
||||||
ctl.pm.Close()
|
ctl.pm.Close()
|
||||||
ctl.vm.Close()
|
ctl.vm.Close()
|
||||||
|
Loading…
Reference in New Issue
Block a user