Commit ad19e6eb authored by bitplane's avatar bitplane

fixed memory leak in 3ds loader when splitting mesh buffers, reported by Dave

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@738 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 5dc996b2
......@@ -936,11 +936,13 @@ void C3DSMeshFileLoader::composeObject(io::IReadFile* file, const core::stringc&
{
u32 vtxCount = mb->Vertices.size();
if (vtxCount>maxPrimitives)
{
Mesh->addMeshBuffer(new SMeshBuffer());
{
IMeshBuffer* tmp = mb;
mb=(SMeshBuffer*)(Mesh->MeshBuffers[mbPos]=Mesh->MeshBuffers.getLast());
Mesh->MeshBuffers[Mesh->MeshBuffers.size()-1]=tmp;
mb = new SMeshBuffer();
Mesh->addMeshBuffer(mb);
mb->drop();
Mesh->MeshBuffers[mbPos] = Mesh->MeshBuffers.getLast();
Mesh->MeshBuffers[Mesh->MeshBuffers.size()-1] = tmp;
mb->getMaterial() = *mat;
vtxCount=0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment