From e1fa7930f5575807e373e37973f24dd3717dfcd4 Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Mon, 22 Apr 2013 19:25:33 +1000 Subject: [PATCH] change iterator erasing so we don't need to overload the = operator --- code/icarus/Sequencer.cpp | 2 +- code/renderer/tr_image.cpp | 5 +++-- code/renderer/tr_model.cpp | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/code/icarus/Sequencer.cpp b/code/icarus/Sequencer.cpp index 5d11ee0..4d2317c 100644 --- a/code/icarus/Sequencer.cpp +++ b/code/icarus/Sequencer.cpp @@ -2383,7 +2383,7 @@ int CSequencer::DestroySequence( CSequence *sequence, CIcarus* icarus ) { if((*tsi).second == sequence) { - tsi = m_taskSequences.erase(tsi); + m_taskSequences.erase(tsi++); } else { diff --git a/code/renderer/tr_image.cpp b/code/renderer/tr_image.cpp index b963b8b..f6c2368 100644 --- a/code/renderer/tr_image.cpp +++ b/code/renderer/tr_image.cpp @@ -1071,8 +1071,8 @@ void R_Images_DeleteLightMaps(void) if (pImage->imgName[0] == '$' /*&& strstr(pImage->imgName,"lightmap")*/) // loose check, but should be ok { R_Images_DeleteImageContents(pImage); - itImage = AllocatedImages.erase(itImage); + AllocatedImages.erase(itImage++); bEraseOccured = qtrue; } } @@ -1221,7 +1221,8 @@ qboolean RE_RegisterImages_LevelLoadEnd(void) { // nope, so dump it... //VID_Printf( PRINT_DEVELOPER, "Dumping image \"%s\"\n",pImage->imgName); R_Images_DeleteImageContents(pImage); - itImage = AllocatedImages.erase(itImage); + + AllocatedImages.erase(itImage++); bEraseOccured = qtrue; } } diff --git a/code/renderer/tr_model.cpp b/code/renderer/tr_model.cpp index a86b5ee..bc2f72d 100644 --- a/code/renderer/tr_model.cpp +++ b/code/renderer/tr_model.cpp @@ -278,7 +278,7 @@ qboolean RE_RegisterModels_LevelLoadEnd(qboolean bDeleteEverythingNotUsedThisLev bAtLeastoneModelFreed = qtrue; } - itModel = CachedModels->erase(itModel); + CachedModels->erase(itModel++); bEraseOccured = qtrue; iLoadedModelBytes = GetModelDataAllocSize(); @@ -328,7 +328,7 @@ static void RE_RegisterModels_DeleteAll(void) Z_Free(CachedModel.pModelDiskImage); } - itModel = CachedModels->erase(itModel); + CachedModels->erase(itModel++); } extern void RE_AnimationCFGs_DeleteAll(void); @@ -1194,4 +1194,4 @@ void R_ModelFree(void) CachedModels = NULL; } } -#endif \ No newline at end of file +#endif