-
-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
panic: close of closed channel #34
Comments
i think the issue is that when we do Close(), it interally calls delete and which again calls Close so it panics always https://github.com/pion/ion-sdk-go/blob/master/client.go#L270 https://github.com/pion/ion-sdk-go/blob/1e8126477a4c28444a8b873d63aa6faf37078108/engine.go#L58 |
also client Close should internally Stop the webm producer as well, if its being used |
I suffer from the same issue. Client.Close() calls Engine.DelClient() which calls Client.Close() again. This makes panic since it tries to close the closed channel, c.notify here. Is there any reason that Engine.DelClient() does c.Close() again? // DelClient delete a client
func (e *Engine) DelClient(c *Client) error {
e.Lock()
if e.clients[c.sid] == nil {
e.Unlock()
return errInvalidSessID
}
/*
if c, ok := e.clients[c.sid][c.uid]; ok && (c != nil) {
c.Close()
}
*/
delete(e.clients[c.sid], c.uid)
e.Unlock()
return nil
} |
Your environment.
What did you do?
https://github.com/pion/ion-sdk-go/blob/master/client.go#L241
if c.Close() is called before publish, it gives a panic
What did you expect?
What happened?
The text was updated successfully, but these errors were encountered: