MMD: Fix delete / delete[] mismatch

Also this was a horrible abuse of std::vector and shouldn't have worked
pull/1672/head
Turo Lamminen 2018-01-02 20:28:08 +02:00
parent 7ebd8e7543
commit aac41cf2c3
1 changed files with 4 additions and 2 deletions

View File

@ -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;
}