From f6a218025a0cbcd12f730d8ef4d47ac40e2d799c Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sun, 30 Apr 2017 04:19:28 +0300 Subject: [PATCH] [Client] Fix actor memory leaks, part 1 --- apps/openmw/mwmp/Cell.cpp | 4 ++++ apps/openmw/mwmp/CellController.cpp | 1 + 2 files changed, 5 insertions(+) diff --git a/apps/openmw/mwmp/Cell.cpp b/apps/openmw/mwmp/Cell.cpp index f1e5bfc8c..0a35f8b03 100644 --- a/apps/openmw/mwmp/Cell.cpp +++ b/apps/openmw/mwmp/Cell.cpp @@ -326,6 +326,8 @@ void Cell::uninitializeLocalActors() for (std::map::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::iterator it = dedicatedActors.begin(); it != dedicatedActors.end(); ++it) { Main::get().getCellController()->removeDedicatedActorRecord(it->first); + delete it->second->creatureStats; + delete it->second; } dedicatedActors.clear(); diff --git a/apps/openmw/mwmp/CellController.cpp b/apps/openmw/mwmp/CellController.cpp index 13bb2d6f5..3913a0e75 100644 --- a/apps/openmw/mwmp/CellController.cpp +++ b/apps/openmw/mwmp/CellController.cpp @@ -38,6 +38,7 @@ void CellController::updateLocal(bool forceUpdate) { mpCell->uninitializeLocalActors(); mpCell->uninitializeDedicatedActors(); + delete it->second; cellsInitialized.erase(it++); } else