Merge pull request #2978 from malortie/scene-combiner-memory-leak

Fixed mValues allocated twice in SceneCombiner.cpp.
pull/2976/head^2
Kim Kulling 2020-02-03 19:02:36 +01:00 committed by GitHub
commit c0dc3b3f58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 1 deletions

View File

@ -1312,7 +1312,6 @@ void SceneCombiner::Copy(aiMetadata** _dest, const aiMetadata* src) {
aiMetadata* dest = *_dest = aiMetadata::Alloc( src->mNumProperties ); aiMetadata* dest = *_dest = aiMetadata::Alloc( src->mNumProperties );
std::copy(src->mKeys, src->mKeys + src->mNumProperties, dest->mKeys); std::copy(src->mKeys, src->mKeys + src->mNumProperties, dest->mKeys);
dest->mValues = new aiMetadataEntry[src->mNumProperties];
for (unsigned int i = 0; i < src->mNumProperties; ++i) { for (unsigned int i = 0; i < src->mNumProperties; ++i) {
aiMetadataEntry& in = src->mValues[i]; aiMetadataEntry& in = src->mValues[i];
aiMetadataEntry& out = dest->mValues[i]; aiMetadataEntry& out = dest->mValues[i];