Kaydet (Commit) f154d002 authored tarafından Julien Nabet's avatar Julien Nabet Kaydeden (comit) Noel Grandin

Fix iterator management

Change-Id: I32ac35d3a4d0cc2376c5890086d1ff011442683d
Reviewed-on: https://gerrit.libreoffice.org/5998Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
Tested-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst 9f4c18e6
......@@ -955,30 +955,27 @@ void GraphicCache::ReleaseGraphicObject( const GraphicObject& rObj )
{
bRemoved = (*it)->ReleaseGraphicObjectReference( rObj );
if( bRemoved )
if( bRemoved && (0 == (*it)->GetGraphicObjectReferenceCount()) )
{
if( 0 == (*it)->GetGraphicObjectReferenceCount() )
// if graphic cache entry has no more references,
// the corresponding display cache object can be removed
GraphicDisplayCacheEntryList::iterator it2 = maDisplayCache.begin();
while( it2 != maDisplayCache.end() )
{
// if graphic cache entry has no more references,
// the corresponding display cache object can be removed
GraphicDisplayCacheEntryList::iterator it2 = maDisplayCache.begin();
while( it2 != maDisplayCache.end() )
GraphicDisplayCacheEntry* pDisplayEntry = *it2;
if( pDisplayEntry->GetReferencedCacheEntry() == *it )
{
GraphicDisplayCacheEntry* pDisplayEntry = *it2;
if( pDisplayEntry->GetReferencedCacheEntry() == *it )
{
mnUsedDisplaySize -= pDisplayEntry->GetCacheSize();
it2 = maDisplayCache.erase( it2 );
delete pDisplayEntry;
}
else
++it2;
mnUsedDisplaySize -= pDisplayEntry->GetCacheSize();
it2 = maDisplayCache.erase( it2 );
delete pDisplayEntry;
}
// delete graphic cache entry
delete *it;
it = maGraphicCache.erase( it );
else
++it2;
}
// delete graphic cache entry
delete *it;
it = maGraphicCache.erase( it );
}
else
++it;
......
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