Skip to content

Commit

Permalink
Add unique_ptr in nodeFunctionFromOgcFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Sep 13, 2018
1 parent 694af1c commit 65d50cd
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/core/qgsogcutils.cpp
Expand Up @@ -3440,23 +3440,22 @@ QgsExpressionNodeFunction *QgsOgcUtilsExpressionFromFilter::nodeFunctionFromOgcF
if ( element.attribute( QStringLiteral( "name" ) ) != funcDef->name() )
continue;

QgsExpressionNode::NodeList *args = new QgsExpressionNode::NodeList();
std::unique_ptr<QgsExpressionNode::NodeList> args( new QgsExpressionNode::NodeList() );

QDomElement operandElem = element.firstChildElement();
while ( !operandElem.isNull() )
{
QgsExpressionNode *op = nodeFromOgcFilter( operandElem );
std::unique_ptr<QgsExpressionNode> op( nodeFromOgcFilter( operandElem ) );
if ( !op )
{
delete args;
return nullptr;
}
args->append( op );
args->append( op.release() );

operandElem = operandElem.nextSiblingElement();
}

return new QgsExpressionNodeFunction( i, args );
return new QgsExpressionNodeFunction( i, args.release() );
}

return nullptr;
Expand Down

0 comments on commit 65d50cd

Please sign in to comment.