diff options
Diffstat (limited to 'package')
-rw-r--r-- | package/source/xstor/ohierarchyholder.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/package/source/xstor/ohierarchyholder.cxx b/package/source/xstor/ohierarchyholder.cxx index 39f177e8bed0..a5fa77653c73 100644 --- a/package/source/xstor/ohierarchyholder.cxx +++ b/package/source/xstor/ohierarchyholder.cxx @@ -301,14 +301,14 @@ void OHierarchyElement_Impl::RemoveElement( const ::rtl::Reference< OHierarchyEl { { ::osl::MutexGuard aGuard( m_aMutex ); - for ( OHierarchyElementList_Impl::iterator aIter = m_aChildren.begin(); - aIter != m_aChildren.end(); /* increment is done in body */) + OHierarchyElementList_Impl::iterator aIter = m_aChildren.begin(); + const OHierarchyElementList_Impl::const_iterator aEnd = m_aChildren.end(); + while (aIter != aEnd) { - OHierarchyElementList_Impl::iterator aTmpIter = aIter; - ++aIter; - - if ( aTmpIter->second == aRef ) - m_aChildren.erase( aTmpIter ); + if (aIter->second == aRef ) + aIter = m_aChildren.erase(aIter); + else + ++aIter; } } |