From 6da6e0511d2b99255a436b5aea60b2eecb7f8557 Mon Sep 17 00:00:00 2001 From: winlin Date: Sat, 11 Mar 2017 16:28:18 +0800 Subject: [PATCH] For #803, should refine code. --- trunk/src/app/srs_app_statistic.cpp | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/trunk/src/app/srs_app_statistic.cpp b/trunk/src/app/srs_app_statistic.cpp index d9bf77143..c3b8cb999 100644 --- a/trunk/src/app/srs_app_statistic.cpp +++ b/trunk/src/app/srs_app_statistic.cpp @@ -359,18 +359,22 @@ 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); - } - + + // TODO: FIXME: Should fix https://github.com/ossrs/srs/issues/803 + if (true) { + std::map::iterator it; + if ((it=streams.find(stream->id)) != streams.end()) { + streams.erase(it); + } + } + + // TODO: FIXME: Should fix https://github.com/ossrs/srs/issues/803 + if (true) { + std::map::iterator it; + if ((it=rstreams.find(stream->url)) != rstreams.end()) { + rstreams.erase(it); + } + } } int SrsStatistic::on_client(int id, SrsRequest* req, SrsConnection* conn, SrsRtmpConnType type)