Fix a memory leak in glTF2.

The destructor of LazyDict uses `delete` but `delete` was not used for objects removed by LazyDict::Remove.
pull/3709/head
Hill Ma 2021-03-17 15:12:54 -07:00
parent 0dbaeb57e3
commit 3e99385f44
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;