Skip to content
Permalink
Browse files
Move deallocation after the failure
  • Loading branch information
elpaso authored and nyalldawson committed Nov 1, 2021
1 parent 06cb0ce commit 51220eb94d18174a765426620cdc00ce2e52b06c
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/providers/postgres/qgspostgresprovider.cpp
@@ -3463,6 +3463,8 @@ bool QgsPostgresProvider::changeFeatures( const QgsChangedAttributesMap &attr_ma
result = conn->PQexecPrepared( QStringLiteral( "updatefeature" ), params );
if ( result.PQresultStatus() != PGRES_COMMAND_OK && result.PQresultStatus() != PGRES_TUPLES_OK )
{
conn->rollback();
conn->PQexecNR( QStringLiteral( "DEALLOCATE updatefeature" ) );
throw PGException( result );
}

@@ -3496,7 +3498,6 @@ bool QgsPostgresProvider::changeFeatures( const QgsChangedAttributesMap &attr_ma
{
pushError( tr( "PostGIS error while changing attributes: %1" ).arg( e.errorMessage() ) );
conn->rollback();
conn->PQexecNR( QStringLiteral( "DEALLOCATE updatefeature" ) );
returnvalue = false;
}

0 comments on commit 51220eb

Please sign in to comment.