Assimp: fixed 3 memory leaks

pull/261/head
Léo Terziman 2013-12-17 10:03:06 +01:00
parent 1bae2bd93f
commit ec3ef0c9d6
2 changed files with 9 additions and 0 deletions

View File

@ -176,6 +176,8 @@ Exporter :: Exporter()
Exporter :: ~Exporter()
{
FreeBlob();
delete pimpl;
}

View File

@ -901,6 +901,9 @@ void SceneCombiner::MergeMaterials(aiMaterial** dest,
size += (*it)->mNumProperties;
}
out->Clear();
delete[] out->mProperties;
out->mNumAllocated = size;
out->mNumProperties = 0;
out->mProperties = new aiMaterialProperty*[out->mNumAllocated];
@ -1062,6 +1065,10 @@ void SceneCombiner::Copy (aiMaterial** _dest, const aiMaterial* src)
ai_assert(NULL != _dest && NULL != src);
aiMaterial* dest = (aiMaterial*) ( *_dest = new aiMaterial() );
dest->Clear();
delete[] dest->mProperties;
dest->mNumAllocated = src->mNumAllocated;
dest->mNumProperties = src->mNumProperties;
dest->mProperties = new aiMaterialProperty* [dest->mNumAllocated];