mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-08 09:37:53 +00:00
Limit pointers cache size to avoid possible bad_alloc errors
This commit is contained in:
parent
af8bc7d120
commit
5de72c94ab
@ -134,7 +134,7 @@ MWWorld::Cells::Cells (const MWWorld::ESMStore& store, std::vector<ESM::ESMReade
|
||||
: mStore (store), mReader (reader),
|
||||
mIdCacheIndex (0)
|
||||
{
|
||||
int cacheSize = std::max(Settings::Manager::getInt("pointers cache size", "Cells"), 0);
|
||||
int cacheSize = std::clamp(Settings::Manager::getInt("pointers cache size", "Cells"), 40, 1000);
|
||||
mIdCache = IdCache(cacheSize, std::pair<std::string, CellStore *> ("", (CellStore*)nullptr));
|
||||
}
|
||||
|
||||
|
@ -175,7 +175,7 @@ pointers cache size
|
||||
-------------------
|
||||
|
||||
:Type: integer
|
||||
:Range: >0
|
||||
:Range: 40 to 1000
|
||||
:Default: 40
|
||||
|
||||
The count of object pointers that will be saved for a faster search by object ID.
|
||||
|
Loading…
Reference in New Issue
Block a user