fix memory leak in case a Wavefront .obj file had multiple shapes (texture was loaded multiple times, while only releasing one)

This commit is contained in:
erwincoumans
2017-06-08 09:21:32 -07:00
parent 9d422c9b08
commit c1f6b7e9b8

View File

@@ -36,7 +36,7 @@ bool b3ImportMeshUtility::loadAndRegisterMeshFromFileInternal(const std::string&
//int textureIndex = -1;
//try to load some texture
for (int i=0;i<shapes.size();i++)
for (int i=0; meshData.m_textureImage==0 && i<shapes.size();i++)
{
const tinyobj::shape_t& shape = shapes[i];
if (shape.material.diffuse_texname.length()>0)