Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Move deallocation after the failure
  • Loading branch information
elpaso authored and nyalldawson committed Oct 7, 2021
1 parent 1b00f68 commit 911db82
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -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 );
}

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 911db82

Please sign in to comment.