Merge pull request #3709 from mahiuchun/erase

Fix a memory leak in glTF2.
pull/3696/head^2
Alexander Gessler 2021-03-18 21:42:54 +01:00 committed by GitHub
commit 191fcafcc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -383,6 +383,7 @@ unsigned int LazyDict<T>::Remove(const char *id) {
mAsset.mUsedIds[id] = false; mAsset.mUsedIds[id] = false;
mObjsById.erase(id); mObjsById.erase(id);
mObjsByOIndex.erase(index); mObjsByOIndex.erase(index);
delete mObjs[index];
mObjs.erase(mObjs.begin() + index); mObjs.erase(mObjs.begin() + index);
//update index of object in mObjs; //update index of object in mObjs;