Skip to content
Permalink
Browse files

Add unique_ptr in nodeSpatialOperatorFromOgcFilter

  • Loading branch information
pblottiere committed Sep 13, 2018
1 parent 0d1da7d commit 180d6b317fd45a3b9f3909ea2b9ca7215c2629ad
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/core/qgsogcutils.cpp
@@ -3265,7 +3265,7 @@ QgsExpressionNodeFunction *QgsOgcUtilsExpressionFromFilter::nodeSpatialOperatorF
// we are exploiting the fact that our function names are the same as the XML tag names
int opIdx = QgsExpression::functionIndex( element.tagName().toLower() );

QgsExpressionNode::NodeList *gml2Args = new QgsExpressionNode::NodeList();
std::unique_ptr<QgsExpressionNode::NodeList> gml2Args( new QgsExpressionNode::NodeList() );
QDomElement childElem = element.firstChildElement();
QString gml2Str;
while ( !childElem.isNull() && gml2Str.isEmpty() )
@@ -3284,13 +3284,12 @@ QgsExpressionNodeFunction *QgsOgcUtilsExpressionFromFilter::nodeSpatialOperatorF
else
{
mErrorMessage = QObject::tr( "No OGC Geometry found" );
delete gml2Args;
return nullptr;
}

QgsExpressionNode::NodeList *opArgs = new QgsExpressionNode::NodeList();
opArgs->append( new QgsExpressionNodeFunction( QgsExpression::functionIndex( QStringLiteral( "$geometry" ) ), new QgsExpressionNode::NodeList() ) );
opArgs->append( new QgsExpressionNodeFunction( QgsExpression::functionIndex( QStringLiteral( "geomFromGML" ) ), gml2Args ) );
opArgs->append( new QgsExpressionNodeFunction( QgsExpression::functionIndex( QStringLiteral( "geomFromGML" ) ), gml2Args.release() ) );

return new QgsExpressionNodeFunction( opIdx, opArgs );
}

0 comments on commit 180d6b3

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