Fix cleanup issue

This commit is contained in:
scrawl 2016-02-10 19:08:17 +01:00
parent d3808580b0
commit 6bfeb118d7
2 changed files with 8 additions and 0 deletions

View file

@ -169,6 +169,13 @@ namespace MWWorld
{
}
CellPreloader::~CellPreloader()
{
for (PreloadMap::iterator it = mPreloadCells.begin(); it != mPreloadCells.end();++it)
it->second.mWorkItem->waitTillDone();
mPreloadCells.clear();
}
void CellPreloader::preload(CellStore *cell, double timestamp)
{
if (!mWorkQueue)

View file

@ -24,6 +24,7 @@ namespace MWWorld
{
public:
CellPreloader(Resource::ResourceSystem* resourceSystem, Resource::BulletShapeManager* bulletShapeManager, Terrain::World* terrain);
~CellPreloader();
/// Ask a background thread to preload rendering meshes and collision shapes for objects in this cell.
/// @note The cell itself must be in State_Loaded or State_Preloaded.