Fixed potential memory leak bug.

This commit is contained in:
jonnxie 2022-04-18 16:54:21 +08:00
parent 5aa182b604
commit fc5ef968cc

View file

@ -273,6 +273,10 @@ void vkglTF::Texture::fromglTfImage(tinygltf::Image &gltfimage, std::string path
vkCmdPipelineBarrier(blitCmd, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, 0, 0, nullptr, 0, nullptr, 1, &imageMemoryBarrier); vkCmdPipelineBarrier(blitCmd, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, 0, 0, nullptr, 0, nullptr, 1, &imageMemoryBarrier);
} }
if (deleteBuffer) {
delete[] buffer;
}
device->flushCommandBuffer(blitCmd, copyQueue, true); device->flushCommandBuffer(blitCmd, copyQueue, true);
} }
else { else {