Merge pull request #3788 from BaldricS/SceneCombiner_Memory_Leaks
Fix: Removing double delete of texture items after MergeScene.pull/3826/head^2
commit
f538b96e82
|
@ -359,7 +359,7 @@ void SceneCombiner::MergeScenes(aiScene **_dest, aiScene *master, std::vector<At
|
|||
|
||||
// generate the output texture list + an offset table for all texture indices
|
||||
if (dest->mNumTextures) {
|
||||
aiTexture **pip = dest->mTextures = new aiTexture *[dest->mNumMaterials];
|
||||
aiTexture **pip = dest->mTextures = new aiTexture *[dest->mNumTextures];
|
||||
cnt = 0;
|
||||
for (unsigned int n = 0; n < src.size(); ++n) {
|
||||
SceneHelper *cur = &src[n];
|
||||
|
@ -638,6 +638,8 @@ void SceneCombiner::MergeScenes(aiScene **_dest, aiScene *master, std::vector<At
|
|||
deleteMe->mMaterials = nullptr;
|
||||
delete[] deleteMe->mAnimations;
|
||||
deleteMe->mAnimations = nullptr;
|
||||
delete[] deleteMe->mTextures;
|
||||
deleteMe->mTextures = nullptr;
|
||||
|
||||
deleteMe->mRootNode = nullptr;
|
||||
|
||||
|
|
Loading…
Reference in New Issue