forked from mirror/openmw-tes3mp
[Client] Fix actor memory leaks, part 1
This commit is contained in:
parent
0ba8a407bc
commit
f6a218025a
2 changed files with 5 additions and 0 deletions
|
@ -326,6 +326,8 @@ void Cell::uninitializeLocalActors()
|
|||
for (std::map<std::string, LocalActor *>::iterator it = localActors.begin(); it != localActors.end(); ++it)
|
||||
{
|
||||
Main::get().getCellController()->removeLocalActorRecord(it->first);
|
||||
delete it->second->creatureStats;
|
||||
delete it->second;
|
||||
}
|
||||
|
||||
localActors.clear();
|
||||
|
@ -336,6 +338,8 @@ void Cell::uninitializeDedicatedActors()
|
|||
for (std::map<std::string, DedicatedActor *>::iterator it = dedicatedActors.begin(); it != dedicatedActors.end(); ++it)
|
||||
{
|
||||
Main::get().getCellController()->removeDedicatedActorRecord(it->first);
|
||||
delete it->second->creatureStats;
|
||||
delete it->second;
|
||||
}
|
||||
|
||||
dedicatedActors.clear();
|
||||
|
|
|
@ -38,6 +38,7 @@ void CellController::updateLocal(bool forceUpdate)
|
|||
{
|
||||
mpCell->uninitializeLocalActors();
|
||||
mpCell->uninitializeDedicatedActors();
|
||||
delete it->second;
|
||||
cellsInitialized.erase(it++);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue