diff --git a/trunk/src/app/srs_app_statistic.cpp b/trunk/src/app/srs_app_statistic.cpp index 3d708a084..d9bf77143 100644 --- a/trunk/src/app/srs_app_statistic.cpp +++ b/trunk/src/app/srs_app_statistic.cpp @@ -358,8 +358,19 @@ void SrsStatistic::on_stream_close(SrsRequest* req) { SrsStatisticVhost* vhost = create_vhost(req); SrsStatisticStream* stream = create_stream(vhost, req); - stream->close(); + + //TODO Is this correct? Something is not released? + std::map::iterator it; + if ((it=streams.find(stream->id)) != streams.end()) { + streams.erase(it); + } + + std::map::iterator sit; + if ((sit=rstreams.find(stream->url)) != rstreams.end()) { + rstreams.erase(sit); + } + } int SrsStatistic::on_client(int id, SrsRequest* req, SrsConnection* conn, SrsRtmpConnType type)