1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

RTC: Fix memory leak for play stream

This commit is contained in:
winlin 2020-07-24 18:39:20 +08:00
parent 069d3ef79d
commit 7ec5ef8497

View file

@ -233,6 +233,20 @@ SrsRtcPlayStream::~SrsRtcPlayStream()
_srs_config->unsubscribe(this); _srs_config->unsubscribe(this);
srs_freep(trd); srs_freep(trd);
if (true) {
std::map<uint32_t, SrsRtcAudioSendTrack*>::iterator it;
for (it = audio_tracks_.begin(); it != audio_tracks_.end(); ++it) {
srs_freep(it->second);
}
}
if (true) {
std::map<uint32_t, SrsRtcVideoSendTrack*>::iterator it;
for (it = video_tracks_.begin(); it != video_tracks_.end(); ++it) {
srs_freep(it->second);
}
}
} }
srs_error_t SrsRtcPlayStream::initialize(SrsRequest* req, std::map<uint32_t, SrsRtcTrackDescription*> sub_relations) srs_error_t SrsRtcPlayStream::initialize(SrsRequest* req, std::map<uint32_t, SrsRtcTrackDescription*> sub_relations)