Merge pull request #934 from jonnxie/jonnxie
Fixed loadAnimation function memory leak bug.
This commit is contained in:
commit
ec7c76d812
1 changed files with 5 additions and 3 deletions
|
|
@ -1074,7 +1074,7 @@ void vkglTF::Model::loadAnimations(tinygltf::Model &gltfModel)
|
||||||
for (size_t index = 0; index < accessor.count; index++) {
|
for (size_t index = 0; index < accessor.count; index++) {
|
||||||
sampler.inputs.push_back(buf[index]);
|
sampler.inputs.push_back(buf[index]);
|
||||||
}
|
}
|
||||||
|
delete[] buf;
|
||||||
for (auto input : sampler.inputs) {
|
for (auto input : sampler.inputs) {
|
||||||
if (input < animation.start) {
|
if (input < animation.start) {
|
||||||
animation.start = input;
|
animation.start = input;
|
||||||
|
|
@ -1100,6 +1100,7 @@ void vkglTF::Model::loadAnimations(tinygltf::Model &gltfModel)
|
||||||
for (size_t index = 0; index < accessor.count; index++) {
|
for (size_t index = 0; index < accessor.count; index++) {
|
||||||
sampler.outputsVec4.push_back(glm::vec4(buf[index], 0.0f));
|
sampler.outputsVec4.push_back(glm::vec4(buf[index], 0.0f));
|
||||||
}
|
}
|
||||||
|
delete[] buf;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TINYGLTF_TYPE_VEC4: {
|
case TINYGLTF_TYPE_VEC4: {
|
||||||
|
|
@ -1108,6 +1109,7 @@ void vkglTF::Model::loadAnimations(tinygltf::Model &gltfModel)
|
||||||
for (size_t index = 0; index < accessor.count; index++) {
|
for (size_t index = 0; index < accessor.count; index++) {
|
||||||
sampler.outputsVec4.push_back(buf[index]);
|
sampler.outputsVec4.push_back(buf[index]);
|
||||||
}
|
}
|
||||||
|
delete[] buf;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue