Use std::copy to copy array and remove user destructor to make sure is_trivially_copyable in order to avoid -Wno-error=nontrivial-memcall (#6029)
Use std::copy to copy array and remove user destructor to make sure is_trivially_copyable in order to avoid -Wno-error=nontrivial-memcall (#6029)
This commit is contained in:
@@ -985,7 +985,7 @@ inline void GetArrayCopy(Type *&dest, ai_uint num) {
|
||||
Type *old = dest;
|
||||
|
||||
dest = new Type[num];
|
||||
::memcpy(dest, old, sizeof(Type) * num);
|
||||
std::copy(old, old+num, dest);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
@@ -1095,10 +1095,6 @@ void SceneCombiner::Copy(aiMesh **_dest, const aiMesh *src) {
|
||||
|
||||
// make a deep copy of all faces
|
||||
GetArrayCopy(dest->mFaces, dest->mNumFaces);
|
||||
for (unsigned int i = 0; i < dest->mNumFaces; ++i) {
|
||||
aiFace &f = dest->mFaces[i];
|
||||
GetArrayCopy(f.mIndices, f.mNumIndices);
|
||||
}
|
||||
|
||||
// make a deep copy of all blend shapes
|
||||
CopyPtrArray(dest->mAnimMeshes, dest->mAnimMeshes, dest->mNumAnimMeshes);
|
||||
|
||||
Reference in New Issue
Block a user