here is fix for memleak when loading terrain data.
Issue #225: Fix for memleak when loading terrain.
Need to think about it more. Your fix is at least incomplete, since copying and assignments will cause problems. But the whole land record code looks incorrect in the first place.
You're right, I will prepare another patch today.
Issue #225: Correction to commit ae98904.
Changed pointer to LandData struct to simple member variable.
is patch 0e5c90d good, or should be changed?
The problem with this approach is that it increases the memory consumption a lot. If my calculations are right easily in the order of magnitude of 100MB. And most of this memory will probably never be used during a playing session.
Actually, the land data should not be part of this record at all, because you are not supposed to modify the ESM store after the loading is complete (it is only possible because some other code breaks constness rules). But that is something we really need think through better and this is not the time for it. As a quick fix, I suggest to return to the pointer approach and disable copy constructor and assignment operator (declare them privately and don't implement them). This will break the code once we start optimising the ESM store containers, but at least it won't do so silently and produces an error message during the build process isntead.
Revert "Issue #225: Correction to commit ae98904."
This reverts commit 0e5c90d.
Issue #225: Land struct is not copyable.
Disabled copy constructor and assignment operator in Land structure.
Copy constructor and assignment operator are now disabled for Land structure.