Skip to content
Permalink
Browse files

Add unique_ptr in nodeFunctionFromOgcFilter

  • Loading branch information
pblottiere committed Sep 13, 2018
1 parent 694af1c commit 65d50cd528f97d83aaab65da1087420b6166ccb2
Showing with 4 additions and 5 deletions.
  1. +4 −5 src/core/qgsogcutils.cpp
@@ -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;

0 comments on commit 65d50cd

Please sign in to comment.
You can’t perform that action at this time.