void QgsSvgCache::trimToMaximumSize() { QgsSvgCacheEntry* entry = mLeastRecentEntry; while ( entry && ( mTotalSize > mMaximumSize ) ) { QgsSvgCacheEntry* bkEntry = entry; entry = entry->nextEntry; takeEntryFromList( bkEntry ); mEntryLookup.remove( bkEntry->file, bkEntry ); mTotalSize -= bkEntry->dataSize(); delete bkEntry; } }
void QgsSvgCache::trimToMaximumSize() { //only one entry in cache if ( mLeastRecentEntry == mMostRecentEntry ) { return; } QgsSvgCacheEntry* entry = mLeastRecentEntry; while ( entry && ( mTotalSize > mMaximumSize ) ) { QgsSvgCacheEntry* bkEntry = entry; entry = entry->nextEntry; takeEntryFromList( bkEntry ); mEntryLookup.remove( bkEntry->lookupKey, bkEntry ); mTotalSize -= bkEntry->dataSize(); delete bkEntry; } }