From b898315962bec435cb3f46db6bd9e6a469b0a04a Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 6 Mar 2017 18:15:53 +0100 Subject: [PATCH] cellpreloader: abort all tasks first before waiting --- apps/openmw/mwworld/cellpreloader.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwworld/cellpreloader.cpp b/apps/openmw/mwworld/cellpreloader.cpp index c870369c95..60c1f9ca04 100644 --- a/apps/openmw/mwworld/cellpreloader.cpp +++ b/apps/openmw/mwworld/cellpreloader.cpp @@ -198,10 +198,11 @@ namespace MWWorld CellPreloader::~CellPreloader() { for (PreloadMap::iterator it = mPreloadCells.begin(); it != mPreloadCells.end();++it) - { it->second.mWorkItem->abort(); + + for (PreloadMap::iterator it = mPreloadCells.begin(); it != mPreloadCells.end();++it) it->second.mWorkItem->waitTillDone(); - } + mPreloadCells.clear(); }