From 3e99385f4487774b3f915f0df3cf9aa6d9942bd3 Mon Sep 17 00:00:00 2001 From: Hill Ma Date: Wed, 17 Mar 2021 15:12:54 -0700 Subject: [PATCH] Fix a memory leak in glTF2. The destructor of LazyDict uses `delete` but `delete` was not used for objects removed by LazyDict::Remove. --- code/AssetLib/glTF2/glTF2Asset.inl | 1 + 1 file changed, 1 insertion(+) diff --git a/code/AssetLib/glTF2/glTF2Asset.inl b/code/AssetLib/glTF2/glTF2Asset.inl index 389a05199..a8d4f2d98 100644 --- a/code/AssetLib/glTF2/glTF2Asset.inl +++ b/code/AssetLib/glTF2/glTF2Asset.inl @@ -383,6 +383,7 @@ unsigned int LazyDict::Remove(const char *id) { mAsset.mUsedIds[id] = false; mObjsById.erase(id); mObjsByOIndex.erase(index); + delete mObjs[index]; mObjs.erase(mObjs.begin() + index); //update index of object in mObjs;