Make the s.sTerminator.endChan nil after we close it

This commit is contained in:
TeoV
2019-05-23 13:56:45 +03:00
committed by Dan Christian Bogos
parent 3882b0408d
commit 11efcce841

View File

@@ -767,6 +767,7 @@ func (sS *SessionS) unregisterSession(cgrID string, passive bool) bool {
if s.sTerminator != nil &&
s.sTerminator.endChan != nil {
close(s.sTerminator.endChan)
s.sTerminator.endChan = nil
time.Sleep(1) // ensure context switching so that the goroutine can remove old terminator
}
}