diff Framework/PostgreSQL/PostgreSQLStatement.cpp @ 46:6a574d810b98

Compatibility with MySQL 8.0
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 18 Jul 2018 12:27:40 +0200
parents b2ff1cd2907a
children 318c1ccb787c
line wrap: on
line diff
--- a/Framework/PostgreSQL/PostgreSQLStatement.cpp	Tue Jul 17 08:50:53 2018 +0200
+++ b/Framework/PostgreSQL/PostgreSQLStatement.cpp	Wed Jul 18 12:27:40 2018 +0200
@@ -342,6 +342,19 @@
   }
 
 
+  PostgreSQLStatement::~PostgreSQLStatement()
+  {
+    try
+    {
+      Unprepare();
+    }
+    catch (Orthanc::OrthancException&)
+    {
+      // Ignore possible exceptions due to connection loss
+    }
+  }
+
+
   void PostgreSQLStatement::Run()
   {
     PGresult* result = reinterpret_cast<PGresult*>(Execute());