diff --git a/trunk/src/core/srs_core_source.cpp b/trunk/src/core/srs_core_source.cpp index 7e1daf300..0ad8c109b 100755 --- a/trunk/src/core/srs_core_source.cpp +++ b/trunk/src/core/srs_core_source.cpp @@ -63,6 +63,12 @@ SrsSource::SrsSource(std::string _stream_url) SrsSource::~SrsSource() { + std::vector::iterator it; + for (it = consumers.begin(); it != consumers.end(); ++it) { + SrsConsumer* consumer = *it; + srs_freep(consumer); + } + consumers.clear(); } int SrsSource::on_meta_data(SrsCommonMessage* msg, SrsOnMetaDataPacket* metadata) @@ -90,6 +96,7 @@ int SrsSource::on_video(SrsCommonMessage* audio) SrsConsumer* SrsSource::create_consumer() { SrsConsumer* consumer = new SrsConsumer(); + consumers.push_back(consumer); return consumer; } diff --git a/trunk/src/core/srs_core_source.hpp b/trunk/src/core/srs_core_source.hpp index 132847f5b..a62807807 100755 --- a/trunk/src/core/srs_core_source.hpp +++ b/trunk/src/core/srs_core_source.hpp @@ -71,6 +71,7 @@ public: static SrsSource* find(std::string stream_url); private: std::string stream_url; + std::vector consumers; public: SrsSource(std::string _stream_url); virtual ~SrsSource();