Add a scope so mapPivot is destroyed when no longer used

pull/4977/head
Turo Lamminen 2023-02-24 13:19:38 +02:00
parent 92f7c50c91
commit 53c6cc0966
1 changed files with 2 additions and 0 deletions

View File

@ -565,6 +565,7 @@ void LWOImporter::GenerateNodeGraph(std::map<uint16_t, aiNode *> &apcNodes) {
root->mName.Set("<LWORoot>"); root->mName.Set("<LWORoot>");
//Set parent of all children, inserting pivots //Set parent of all children, inserting pivots
{
std::map<uint16_t, aiNode *> mapPivot; std::map<uint16_t, aiNode *> mapPivot;
for (auto itapcNodes = apcNodes.begin(); itapcNodes != apcNodes.end(); ++itapcNodes) { for (auto itapcNodes = apcNodes.begin(); itapcNodes != apcNodes.end(); ++itapcNodes) {
@ -599,6 +600,7 @@ void LWOImporter::GenerateNodeGraph(std::map<uint16_t, aiNode *> &apcNodes) {
for (auto itMapPivot = mapPivot.begin(); itMapPivot != mapPivot.end(); ++itMapPivot) { for (auto itMapPivot = mapPivot.begin(); itMapPivot != mapPivot.end(); ++itMapPivot) {
apcNodes[itMapPivot->first] = itMapPivot->second; apcNodes[itMapPivot->first] = itMapPivot->second;
} }
}
//Set children of all parents //Set children of all parents
apcNodes[(uint16_t)-1] = root; apcNodes[(uint16_t)-1] = root;