Merge pull request #198 from lioncash/move

CResFactory: Resolve use-after-move in AddToLoadList()
This commit is contained in:
Phillip Stephens 2020-03-08 18:03:28 -07:00 committed by GitHub
commit f07d4e9630
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -7,7 +7,8 @@ namespace urde {
static logvisor::Module Log("CResFactory");
void CResFactory::AddToLoadList(SLoadingData&& data) {
m_loadMap[data.x0_tag] = m_loadList.insert(m_loadList.end(), std::move(data));
const SObjectTag tag = data.x0_tag;
m_loadMap.insert_or_assign(tag, m_loadList.insert(m_loadList.end(), std::move(data)));
}
CFactoryFnReturn CResFactory::BuildSync(const SObjectTag& tag, const CVParamTransfer& xfer, CObjectReference* selfRef) {