[Server] Fix invalid read

This commit is contained in:
Koncord 2018-02-16 04:38:42 +08:00
parent 69436714f9
commit a9614ad28e

View file

@ -87,8 +87,9 @@ void Players::deletePlayerByPID(int pid)
if (it != ls.end())
{
(*it)->markedForDeletion = true;
size_t useCount = it->use_count();
ls.erase(it);
LOG_APPEND(Log::LOG_TRACE, "- references: %d", it->use_count());
LOG_APPEND(Log::LOG_TRACE, "- references: %d", useCount - 1);
}
}