From e52b3dccf14a7606b5a19bcd1a763a377b59e873 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 21 Apr 2016 10:59:36 +0100 Subject: Don't attempt to close cursors when in failed transaction (it's failed and result in sigabrt) --- libpqpp/pq-selectcommand.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libpqpp/pq-selectcommand.cpp') diff --git a/libpqpp/pq-selectcommand.cpp b/libpqpp/pq-selectcommand.cpp index f8f44fd..b049eea 100644 --- a/libpqpp/pq-selectcommand.cpp +++ b/libpqpp/pq-selectcommand.cpp @@ -24,7 +24,7 @@ PQ::SelectCommand::~SelectCommand() if (execRes) { PQclear(execRes); } - if (executed) { + if (executed && PQtransactionStatus(c->conn) != PQTRANS_INERROR) { c->checkResultFree((PQexec(c->conn, s_close.c_str())), PGRES_COMMAND_OK); } if (txOpened) { -- cgit v1.2.3