summaryrefslogtreecommitdiffstats
path: root/include/astra/AstraObjectManager.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/astra/AstraObjectManager.h')
-rw-r--r--include/astra/AstraObjectManager.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/astra/AstraObjectManager.h b/include/astra/AstraObjectManager.h
index 35b4534..ad89c2a 100644
--- a/include/astra/AstraObjectManager.h
+++ b/include/astra/AstraObjectManager.h
@@ -216,11 +216,10 @@ T* CAstraObjectManager<T>::get(int _iIndex) const
template <typename T>
void CAstraObjectManager<T>::remove(int _iIndex)
{
- if (!hasIndex(_iIndex)) {
- return;
- }
// find data
typename map<int,T*>::iterator it = m_mIndexToObject.find(_iIndex);
+ if (it == m_mIndexToObject.end())
+ return;
// delete data
delete (*it).second;
// delete from map