From 6bfeb118d7ecae3bc528ff558656c42caaa8c6ec Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 10 Feb 2016 19:08:17 +0100 Subject: [PATCH] Fix cleanup issue --- apps/openmw/mwworld/cellpreloader.cpp | 7 +++++++ apps/openmw/mwworld/cellpreloader.hpp | 1 + 2 files changed, 8 insertions(+) diff --git a/apps/openmw/mwworld/cellpreloader.cpp b/apps/openmw/mwworld/cellpreloader.cpp index ce9a87beb..6acb41dc3 100644 --- a/apps/openmw/mwworld/cellpreloader.cpp +++ b/apps/openmw/mwworld/cellpreloader.cpp @@ -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) diff --git a/apps/openmw/mwworld/cellpreloader.hpp b/apps/openmw/mwworld/cellpreloader.hpp index 32ea194c6..437395397 100644 --- a/apps/openmw/mwworld/cellpreloader.hpp +++ b/apps/openmw/mwworld/cellpreloader.hpp @@ -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.