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