Skip to content

Commit 104b4d9

Browse files
committed
Fix for SVG cache
1 parent 59222a0 commit 104b4d9

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/core/symbology-ng/qgssvgcache.cpp

+9-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,10 @@ const QImage& QgsSvgCache::svgAsImage( const QString& file, double size, const Q
136136
//currentEntry->image = new QImage( 0, 0 );
137137

138138
// instead cache picture
139-
cachePicture( currentEntry );
139+
if ( !currentEntry->picture )
140+
{
141+
cachePicture( currentEntry );
142+
}
140143
}
141144
else
142145
{
@@ -693,6 +696,11 @@ void QgsSvgCache::printEntryList()
693696

694697
void QgsSvgCache::trimToMaximumSize()
695698
{
699+
//only one entry in cache
700+
if ( mLeastRecentEntry == mMostRecentEntry )
701+
{
702+
return;
703+
}
696704
QgsSvgCacheEntry* entry = mLeastRecentEntry;
697705
while ( entry && ( mTotalSize > mMaximumSize ) )
698706
{

0 commit comments

Comments
 (0)