Kaydet (Commit) 345303a6 authored tarafından Herbert Dürr's avatar Herbert Dürr

#i123418# prevent iterator decrement when it is at begin()

also prevent derefencing of an iterator after it has been erased
üst 67a5b7b9
......@@ -1408,23 +1408,26 @@ void SAL_CALL SbaTableQueryBrowser::disposing( const EventObject& _rSource ) thr
{
for ( ExternalFeaturesMap::iterator aLoop = m_aExternalFeatures.begin();
aLoop != m_aExternalFeatures.end();
++aLoop
)
{
if ( aLoop->second.xDispatcher.get() == xSource.get() )
{
ExternalFeaturesMap::iterator aPrevious = aLoop;
--aPrevious;
if ( aLoop->second.xDispatcher.get() != xSource.get() ) {
++aLoop;
continue;
}
// remove it
m_aExternalFeatures.erase( aLoop );
// prepare to erase the aLoop iterator
const sal_uInt16 nSlotId = aLoop->first;
ExternalFeaturesMap::iterator aNext = aLoop;
++aNext;
// maybe update the UI
implCheckExternalSlot(aLoop->first);
// remove it
m_aExternalFeatures.erase( aLoop );
// continue, the same XDispatch may be resposible for more than one URL
aLoop = aPrevious;
}
// maybe update the UI
implCheckExternalSlot( nSlotId );
// continue, the same XDispatch may be resposible for more than one URL
aLoop = aNext;
}
}
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment