diff options
Diffstat (limited to 'libpqpp/pq-selectcommand.cpp')
-rw-r--r-- | libpqpp/pq-selectcommand.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/libpqpp/pq-selectcommand.cpp b/libpqpp/pq-selectcommand.cpp index 6c02fc4..55dc02c 100644 --- a/libpqpp/pq-selectcommand.cpp +++ b/libpqpp/pq-selectcommand.cpp @@ -21,15 +21,12 @@ PQ::SelectCommand::SelectCommand(Connection * conn, const std::string & sql, uns PQ::SelectCommand::~SelectCommand() { + if (executed) { + c->checkResultFree((PQexec(c->conn, s_close.c_str())), PGRES_COMMAND_OK); + } if (txOpened) { c->commitTx(); } - if (executed) { - PQclear(PQexec(c->conn, s_close.c_str())); - if (execRes) { - PQclear(execRes); - } - } } std::string |