mirror of
https://github.com/aler9/gortsplib
synced 2025-11-03 11:11:01 +08:00
fix memory leak when publishing
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user