fix memory leak when publishing

This commit is contained in:
aler9
2020-11-15 18:03:29 +01:00
parent 3f45d21f11
commit 5636d64651

View File

@@ -104,10 +104,12 @@ type ConnClient struct {
func (c *ConnClient) Close() error {
s := c.state.load()
if s == connClientStatePlay {
if s == connClientStatePlay || s == connClientStateRecord {
close(c.backgroundTerminate)
<-c.backgroundDone
}
if s == connClientStatePlay {
c.Do(&base.Request{
Method: base.TEARDOWN,
URL: c.streamUrl,