Fixed loadNode function memory leak bug.
This commit is contained in:
parent
27325de13b
commit
c15d44e855
1 changed files with 5 additions and 2 deletions
|
|
@ -906,6 +906,7 @@ void vkglTF::Model::loadNode(vkglTF::Node *parent, const tinygltf::Node &node, u
|
||||||
for (size_t index = 0; index < accessor.count; index++) {
|
for (size_t index = 0; index < accessor.count; index++) {
|
||||||
indexBuffer.push_back(buf[index] + vertexStart);
|
indexBuffer.push_back(buf[index] + vertexStart);
|
||||||
}
|
}
|
||||||
|
delete[] buf;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TINYGLTF_PARAMETER_TYPE_UNSIGNED_SHORT: {
|
case TINYGLTF_PARAMETER_TYPE_UNSIGNED_SHORT: {
|
||||||
|
|
@ -914,6 +915,7 @@ void vkglTF::Model::loadNode(vkglTF::Node *parent, const tinygltf::Node &node, u
|
||||||
for (size_t index = 0; index < accessor.count; index++) {
|
for (size_t index = 0; index < accessor.count; index++) {
|
||||||
indexBuffer.push_back(buf[index] + vertexStart);
|
indexBuffer.push_back(buf[index] + vertexStart);
|
||||||
}
|
}
|
||||||
|
delete[] buf;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TINYGLTF_PARAMETER_TYPE_UNSIGNED_BYTE: {
|
case TINYGLTF_PARAMETER_TYPE_UNSIGNED_BYTE: {
|
||||||
|
|
@ -922,6 +924,7 @@ void vkglTF::Model::loadNode(vkglTF::Node *parent, const tinygltf::Node &node, u
|
||||||
for (size_t index = 0; index < accessor.count; index++) {
|
for (size_t index = 0; index < accessor.count; index++) {
|
||||||
indexBuffer.push_back(buf[index] + vertexStart);
|
indexBuffer.push_back(buf[index] + vertexStart);
|
||||||
}
|
}
|
||||||
|
delete[] buf;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue