From 994159fafd8834a477b04ab9b48cbc3d5f8d67bf Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Fri, 17 Oct 2014 14:23:37 +0200 Subject: [PATCH] fixed broken iterator --- apps/opencs/view/render/pagedworldspacewidget.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/opencs/view/render/pagedworldspacewidget.cpp b/apps/opencs/view/render/pagedworldspacewidget.cpp index d1f259402..8b143e93f 100644 --- a/apps/opencs/view/render/pagedworldspacewidget.cpp +++ b/apps/opencs/view/render/pagedworldspacewidget.cpp @@ -42,9 +42,6 @@ bool CSVRender::PagedWorldspaceWidget::adjustCells() if (!mSelection.has (iter->first) || index==-1 || cells.getRecord (index).mState==CSMWorld::RecordBase::State_Deleted) { - delete iter->second; - mCells.erase (iter); - // delete overlays std::map::iterator itOverlay = mTextOverlays.find(iter->first); if(itOverlay != mTextOverlays.end()) @@ -56,7 +53,9 @@ bool CSVRender::PagedWorldspaceWidget::adjustCells() // destroy manual objects getSceneManager()->destroyManualObject("manual"+iter->first.getId(mWorldspace)); - iter++; + delete iter->second; + mCells.erase (iter++); + modified = true; } else