Ue new alloc semantic when using aiMetadata + increase test coverage.

This commit is contained in:
Kim Kulling
2016-11-22 21:06:14 +01:00
parent 566aa1ae00
commit a446d75250
8 changed files with 209 additions and 111 deletions

View File

@@ -707,15 +707,11 @@ aiNode* ProcessSpatialStructure(aiNode* parent, const IfcProduct& el, Conversion
}
if (!properties.empty()) {
aiMetadata* data = new aiMetadata();
data->mNumProperties = properties.size();
data->mKeys = new aiString[data->mNumProperties]();
data->mValues = new aiMetadataEntry[data->mNumProperties]();
unsigned int index = 0;
for(const Metadata::value_type& kv : properties)
data->Set(index++, kv.first, aiString(kv.second));
aiMetadata* data = aiMetadata::Alloc( properties.size() );
unsigned int index( 0 );
for ( const Metadata::value_type& kv : properties ) {
data->Set( index++, kv.first, aiString( kv.second ) );
}
nd->mMetaData = data;
}
}