1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-17 19:10:24 +00:00

Fix possible usage of destroyed variable

This commit is contained in:
Andrei Kortunov 2019-11-13 15:46:49 +04:00
parent 34873b6065
commit 3970baeb84

View File

@ -49,7 +49,7 @@ void ESMStore::load(ESM::ESMReader &esm, Loading::Listener* listener)
std::string fname = mast.name; std::string fname = mast.name;
int index = ~0; int index = ~0;
for (int i = 0; i < esm.getIndex(); i++) { for (int i = 0; i < esm.getIndex(); i++) {
const std::string &candidate = allPlugins->at(i).getContext().filename; const std::string candidate = allPlugins->at(i).getContext().filename;
std::string fnamecandidate = boost::filesystem::path(candidate).filename().string(); std::string fnamecandidate = boost::filesystem::path(candidate).filename().string();
if (Misc::StringUtils::ciEqual(fname, fnamecandidate)) { if (Misc::StringUtils::ciEqual(fname, fnamecandidate)) {
index = i; index = i;