fix memory leak on long run room/participant (#1169)
* Fix memory leak * update pion * clean code
This commit is contained in:
@@ -33,7 +33,10 @@ func (r *RTCPReader) OnClose(fn func()) {
|
||||
}
|
||||
|
||||
func (r *RTCPReader) Close() error {
|
||||
r.closed.Store(true)
|
||||
if r.closed.Swap(true) {
|
||||
return nil
|
||||
}
|
||||
|
||||
r.onClose()
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user