SL-18602 Crashfix

meow-7.2.2
Andrey Kleshchev 2022-11-10 23:50:46 +02:00
parent 424593c05e
commit 44782e475c
1 changed files with 13 additions and 7 deletions

View File

@ -2219,10 +2219,6 @@ void LLSelectMgr::selectionRevertGLTFMaterials()
LLUUID asset_id = nodep->mSavedGLTFMaterialIds[te];
objectp->setRenderMaterialID(te, asset_id, false /*wait for bulk update*/);
// Restore overrides
LLSD overrides;
overrides["object_id"] = objectp->getID();
overrides["side"] = te;
// todo: make sure this does not cause race condition with setRenderMaterialID
// when we are reverting from null id to non null plus override
@ -2230,10 +2226,20 @@ void LLSelectMgr::selectionRevertGLTFMaterials()
&& nodep->mSavedGLTFOverrideMaterials[te].notNull()
&& asset_id.notNull())
{
overrides["gltf_json"] = nodep->mSavedGLTFOverrideMaterials[te]->asJSON();
} // else nothing to blank override out
// Restore overrides
LLSD overrides;
overrides["object_id"] = objectp->getID();
overrides["side"] = te;
overrides["gltf_json"] = nodep->mSavedGLTFOverrideMaterials[te]->asJSON();
LLGLTFMaterialList::queueUpdate(overrides);
}
else
{
//blank override out
LLGLTFMaterialList::queueApply(objectp->getID(), te, asset_id);
}
LLGLTFMaterialList::queueUpdate(overrides);
}
return true;
}