未验证 提交 8baac51c 编写于 作者: R Rob Taglang 提交者: GitHub

Fix memory-management error for GLTF 1.0 materials (#267)

上级 bc2f31e5
......@@ -7,6 +7,7 @@ Change Log
##### Fixes :wrench:
* De-duplicate GLTF generated materials [#251](https://github.com/KhronosGroup/COLLADA2GLTF/issues/251)
* Fix seg-fault exporting GLTF 1.0 [#261](https://github.com/KhronosGroup/COLLADA2GLTF/issues/261)
### v2.1.5 - 2019-05-22
......
......@@ -1454,6 +1454,10 @@ void GLTF::Asset::writeJSON(void* writer, GLTF::Options* options) {
primitive->attributes.end();
GLTF::Material* materialGlsl =
materialCommon->getMaterial(lights, hasColor, options);
// New material will take ownership of values
materialCommon->values = nullptr;
generatedTechniques[techniqueKey] = materialGlsl->technique;
generatedMaterialsMap[material] = materialGlsl;
material = materialGlsl;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册