mirror of
https://github.com/bulletphysics/bullet3.git
synced 2026-08-13 08:49:29 +00:00
fix potential memory leak in createMultiBody, reported by Fei Xia here (thanks for report/repro!)
https://github.com/bulletphysics/bullet3/issues/2898
This commit is contained in:
@@ -2521,6 +2521,17 @@ struct ProgrammaticUrdfInterface : public URDFImporterInterface
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//delete textures
|
||||
for (int i = 0; i < textures.size(); i++)
|
||||
{
|
||||
B3_PROFILE("free textureData");
|
||||
if (!textures[i].m_isCached)
|
||||
{
|
||||
free(textures[i].textureData1);
|
||||
}
|
||||
}
|
||||
|
||||
return graphicsIndex;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user