shinyoshiaki / werift-webrtc

WebRTC Implementation for TypeScript (Node.js), includes ICE/DTLS/SCTP/RTP/SRTP/WEBM/MP4
MIT License
469 stars 30 forks source link

dispose track on stop rtp send #303

Closed kolserdav closed 1 year ago

kolserdav commented 1 year ago

if you print this line https://github.com/shinyoshiaki/werift-webrtc/blob/f916e893ac895945ab899edf24c88481634a1e53/packages/webrtc/src/media/rtpSender.ts#L196 to the log at runtime, you can see that even after the connection between the clients is broken, if the track still exists, then this callback continues to work, which undoubtedly leads to a memory leak.