修复rtmp推拉流内存泄漏问题

This commit is contained in:
yangjiechina
2024-06-28 20:56:18 +08:00
parent 8d886d1444
commit ece14dbc27
18 changed files with 127 additions and 102 deletions

View File

@@ -441,6 +441,12 @@ func (s *PublishSource) doClose() {
if s.Conn != nil {
s.Conn.Close()
s.Conn = nil
}
if s.TransDeMuxer != nil {
s.TransDeMuxer.Close()
s.TransDeMuxer = nil
}
//清空未写完的buffer
@@ -453,13 +459,18 @@ func (s *PublishSource) doClose() {
//释放GOP缓存
if s.gopBuffer != nil {
s.gopBuffer.Clear()
s.gopBuffer.Close()
s.gopBuffer = nil
}
if s.probeTimer != nil {
s.probeTimer.Stop()
}
if s.receiveDataTimer != nil {
s.receiveDataTimer.Stop()
}
if s.idleTimer != nil {
s.idleTimer.Stop()
}