From 1b0934ec6c91e1c11fe418df1cf3e600138c4e5c Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 9 Oct 2024 22:48:16 +1100 Subject: [PATCH] Don't use an iterator after it's erased. --- CesiumGltf/include/CesiumGltf/SharedAssetDepot.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CesiumGltf/include/CesiumGltf/SharedAssetDepot.h b/CesiumGltf/include/CesiumGltf/SharedAssetDepot.h index a0c452aaf..0c4c6dceb 100644 --- a/CesiumGltf/include/CesiumGltf/SharedAssetDepot.h +++ b/CesiumGltf/include/CesiumGltf/SharedAssetDepot.h @@ -229,8 +229,8 @@ class SharedAssetDepot : public CesiumUtility::ReferenceCountedThreadSafe< it != this->deletionCandidates.end(); ++it) { if ((*it)->getUniqueAssetId() == assetId) { - this->deletionCandidates.erase(it); this->totalDeletionCandidateMemoryUsage -= (*it)->getSizeBytes(); + this->deletionCandidates.erase(it); break; } }