From 9847d2c4a8287f220f169236b4fa1962d50d1187 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 16 Feb 2016 15:22:59 +0100 Subject: Also remove objects from index manager --- include/astra/AstraObjectManager.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/astra/AstraObjectManager.h b/include/astra/AstraObjectManager.h index eab3f03..8b9da30 100644 --- a/include/astra/AstraObjectManager.h +++ b/include/astra/AstraObjectManager.h @@ -77,6 +77,13 @@ public: return 0; } + void remove(int index) { + std::map::iterator i; + i = m_table.find(index); + if (i != m_table.end()) + m_table.erase(i); + } + private: /** The index last handed out */ @@ -216,7 +223,9 @@ void CAstraObjectManager::remove(int _iIndex) // delete data delete (*it).second; // delete from map - m_mIndexToObject.erase(it); + m_mIndexToObject.erase(it); + + CAstraIndexManager::getSingleton().remove(_iIndex); } //---------------------------------------------------------------------------------------- -- cgit v1.2.3