Skip to content

Commit

Permalink
Categorized renderer: fix memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jan 9, 2014
1 parent 6175f24 commit 63ba802
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp
Expand Up @@ -142,6 +142,7 @@ QgsCategorizedSymbolRendererV2::QgsCategorizedSymbolRendererV2( QString attrName
mSourceColorRamp( NULL ),
mInvertedColorRamp( false ),
mScaleMethod( DEFAULT_SCALE_METHOD ),
mExpression( 0 ),
mRotationFieldIdx( -1 ),
mSizeScaleFieldIdx( -1 )
{
Expand Down Expand Up @@ -199,8 +200,9 @@ QgsSymbolV2* QgsCategorizedSymbolRendererV2::symbolForFeature( QgsFeature& featu
{
const QgsAttributes& attrs = feature.attributes();
QVariant value;
if ( mAttrNum < 0 || mAttrNum >= attrs.count() )
if ( mAttrNum == -1 )
{
Q_ASSERT( mExpression );
value = mExpression->evaluate( &feature );
}
else
Expand Down Expand Up @@ -406,6 +408,7 @@ void QgsCategorizedSymbolRendererV2::stopRender( QgsRenderContext& context )
delete it2.value();
}
mTempSymbols.clear();
delete mExpression;
}

QList<QString> QgsCategorizedSymbolRendererV2::usedAttributes()
Expand Down

0 comments on commit 63ba802

Please sign in to comment.