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