MMD: Fix delete / delete[] mismatch
Also this was a horrible abuse of std::vector and shouldn't have worked
This commit is contained in:
@@ -324,8 +324,10 @@ aiMesh *MMDImporter::CreateMesh(const pmx::PmxModel *pModel,
|
||||
auto it = bone_vertex_map.find(ii);
|
||||
if (it != bone_vertex_map.end()) {
|
||||
pBone->mNumWeights = static_cast<unsigned int>(it->second.size());
|
||||
pBone->mWeights = it->second.data();
|
||||
it->second.swap(*(new vector<aiVertexWeight>));
|
||||
pBone->mWeights = new aiVertexWeight[pBone->mNumWeights];
|
||||
for (unsigned int j = 0; j < pBone->mNumWeights; j++) {
|
||||
pBone->mWeights[j] = it->second[j];
|
||||
}
|
||||
}
|
||||
bone_ptr_ptr[ii] = pBone;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user