summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2018-11-24 18:54:39 +0100
committerJulien Nabet <serval2412@yahoo.fr>2018-11-24 21:37:24 +0100
commit487ed7fdd6ea9687336112afcd80e7e8d723b8fc (patch)
tree145aa04d6705f0d20a6529c875db6d3fc5a3d5cc
parent843c55d132a1889ffbdfe230a48bb6dfae7d62a3 (diff)
Use returned iterator by list::erase
Change-Id: I42312f5cbd0de65cc8915e6833eff668d244f66b Reviewed-on: https://gerrit.libreoffice.org/63956 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
-rw-r--r--package/source/xstor/ohierarchyholder.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/package/source/xstor/ohierarchyholder.cxx b/package/source/xstor/ohierarchyholder.cxx
index 5f6cf2291b54..800cfdf7ce1f 100644
--- a/package/source/xstor/ohierarchyholder.cxx
+++ b/package/source/xstor/ohierarchyholder.cxx
@@ -267,9 +267,14 @@ void SAL_CALL OHierarchyElement_Impl::disposing( const lang::EventObject& Source
for ( OWeakStorRefList_Impl::iterator pStorageIter = m_aOpenStreams.begin();
pStorageIter != m_aOpenStreams.end(); )
{
- OWeakStorRefList_Impl::iterator pTmp = pStorageIter++;
- if ( !pTmp->get().is() || pTmp->get() == xStream )
- m_aOpenStreams.erase( pTmp );
+ if ( !pStorageIter->get().is() || pStorageIter->get() == xStream )
+ {
+ pStorageIter = m_aOpenStreams.erase(pStorageIter);
+ }
+ else
+ {
+ ++pStorageIter;
+ }
}
aGuard.clear();