From a708ac488e34c85a783243f462e4301093e62db8 Mon Sep 17 00:00:00 2001 From: scrawl <720642+scrawl@users.noreply.github.com> Date: Tue, 13 Feb 2018 00:38:55 +0000 Subject: [PATCH] Don't call Store::setUp() unnecessarily Fixes a threading issue with ESM::Land store caused by calling setUp() while it's being used. --- apps/openmw/mwworld/store.cpp | 5 +++++ apps/openmw/mwworld/store.hpp | 1 + apps/openmw/mwworld/worldimp.cpp | 1 - 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwworld/store.cpp b/apps/openmw/mwworld/store.cpp index 704dbf970e..9279e3fe77 100644 --- a/apps/openmw/mwworld/store.cpp +++ b/apps/openmw/mwworld/store.cpp @@ -607,6 +607,11 @@ namespace MWWorld } return ptr; } + void Store::clearDynamic() + { + setUp(); + } + void Store::setUp() { typedef DynamicExt::iterator ExtIterator; diff --git a/apps/openmw/mwworld/store.hpp b/apps/openmw/mwworld/store.hpp index 3babea86aa..00ea6f66f8 100644 --- a/apps/openmw/mwworld/store.hpp +++ b/apps/openmw/mwworld/store.hpp @@ -293,6 +293,7 @@ namespace MWWorld const ESM::Cell *find(const std::string &id) const; const ESM::Cell *find(int x, int y) const; + virtual void clearDynamic(); void setUp(); RecordId load(ESM::ESMReader &esm); diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 02e0737ee8..7786b6823e 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -295,7 +295,6 @@ namespace MWWorld mWorldScene->clear(); mStore.clearDynamic(); - mStore.setUp(); if (mPlayer) {