The following commit has been merged in the master branch: commit 2c0fb43986aa00fb954851d4519f9a82a1c10cef Author: Giuseppe Sucameli <brush.ty...@gmail.com> Date: Wed Mar 14 00:58:26 2012 +0100
fix memory leak instantiating QgsExpression in actions diff --git a/src/core/qgsattributeaction.cpp b/src/core/qgsattributeaction.cpp index b5a8fe5..1fc78f7 100644 --- a/src/core/qgsattributeaction.cpp +++ b/src/core/qgsattributeaction.cpp @@ -206,7 +206,7 @@ QString QgsAttributeAction::expandAction( QString action, QgsFeature &feat, cons index = pos + rx.matchedLength(); QString to_replace = rx.cap( 1 ).trimmed(); - QgsDebugMsg( "Found expression:" + to_replace ); + QgsDebugMsg( "Found expression: " + to_replace ); if ( substitutionMap && substitutionMap->contains( to_replace ) ) { @@ -214,18 +214,18 @@ QString QgsAttributeAction::expandAction( QString action, QgsFeature &feat, cons continue; } - QgsExpression* exp = new QgsExpression( to_replace ); - if ( exp->hasParserError() ) + QgsExpression exp( to_replace ); + if ( exp.hasParserError() ) { - QgsDebugMsg( "Expression parser error:" + exp->parserErrorString() ); + QgsDebugMsg( "Expression parser error: " + exp.parserErrorString() ); expr_action += action.mid( start, index - start ); continue; } - QVariant result = exp->evaluate( &feat, mLayer->pendingFields() ); - if ( exp->hasEvalError() ) + QVariant result = exp.evaluate( &feat, mLayer->pendingFields() ); + if ( exp.hasEvalError() ) { - QgsDebugMsg( "Expression parser eval error:" + exp->evalErrorString() ); + QgsDebugMsg( "Expression parser eval error: " + exp.evalErrorString() ); expr_action += action.mid( start, index - start ); continue; } -- The Quantum GIS in Debian project _______________________________________________ Pkg-grass-devel mailing list Pkg-grass-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel