forked from teamnwah/openmw-tes3coop
[Server] Fix invalid read
This commit is contained in:
parent
69436714f9
commit
a9614ad28e
1 changed files with 2 additions and 1 deletions
|
@ -87,8 +87,9 @@ void Players::deletePlayerByPID(int pid)
|
||||||
if (it != ls.end())
|
if (it != ls.end())
|
||||||
{
|
{
|
||||||
(*it)->markedForDeletion = true;
|
(*it)->markedForDeletion = true;
|
||||||
|
size_t useCount = it->use_count();
|
||||||
ls.erase(it);
|
ls.erase(it);
|
||||||
LOG_APPEND(Log::LOG_TRACE, "- references: %d", it->use_count());
|
LOG_APPEND(Log::LOG_TRACE, "- references: %d", useCount - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue