Fix controller segfault on using fillActive function during stats update.
This commit is contained in:
parent
324d29fb0c
commit
f010dcd0f7
1 changed files with 9 additions and 6 deletions
|
@ -910,6 +910,8 @@ void Controller::fillActive(JSON::Value & req, JSON::Value & rep, bool onlyNow){
|
|||
std::map<std::string, unsigned long> clients;
|
||||
unsigned int t = Util::epoch() - STATS_DELAY;
|
||||
//check all sessions
|
||||
{
|
||||
tthread::lock_guard<tthread::mutex> guard(statsMutex);
|
||||
if (sessions.size()){
|
||||
for (std::map<sessIndex, statSession>::iterator it = sessions.begin(); it != sessions.end(); it++){
|
||||
if (!onlyNow || (it->second.hasDataFor(t) && it->second.isViewerOn(t))){
|
||||
|
@ -920,6 +922,7 @@ void Controller::fillActive(JSON::Value & req, JSON::Value & rep, bool onlyNow){
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//Good, now output what we found...
|
||||
rep.null();
|
||||
for (std::set<std::string>::iterator it = streams.begin(); it != streams.end(); it++){
|
||||
|
|
Loading…
Add table
Reference in a new issue