summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorTerrence Enger <tenger@iseries-guru.com>2011-10-27 16:37:50 -0400
committerNoel Power <noel.power@novell.com>2011-10-28 10:19:04 +0100
commit9b58d9353073c6535da0529cd9a48e435f043fa8 (patch)
treee02b7e6ff5b722649beb06dbea663d2cd867653e /connectivity
parent853b1852200325098e8aadbfbdf1fcf70a50bce1 (diff)
leaking connection handle
call SQLDisconnect; check returns from SQLDisconnect and SQLFreeHandle
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/odbcbase/OConnection.cxx20
1 files changed, 18 insertions, 2 deletions
diff --git a/connectivity/source/drivers/odbcbase/OConnection.cxx b/connectivity/source/drivers/odbcbase/OConnection.cxx
index 891eabc7d5eb..03bc39b8f635 100644
--- a/connectivity/source/drivers/odbcbase/OConnection.cxx
+++ b/connectivity/source/drivers/odbcbase/OConnection.cxx
@@ -78,8 +78,24 @@ OConnection::~OConnection()
close();
if ( SQL_NULL_HANDLE != m_aConnectionHandle )
- N3SQLFreeHandle( SQL_HANDLE_DBC, m_aConnectionHandle );
- m_aConnectionHandle = SQL_NULL_HANDLE;
+ {
+ SQLRETURN rc;
+
+ rc = N3SQLDisconnect( m_aConnectionHandle );
+ if ( SQL_SUCCESS != rc &&
+ SQL_SUCCESS_WITH_INFO != rc )
+ OSL_TRACE( "Failure from SQLDisconnect, %s:%i"
+ , __FILE__, __LINE__
+ );
+
+ rc = N3SQLFreeHandle( SQL_HANDLE_DBC, m_aConnectionHandle );
+ if ( SQL_SUCCESS != rc )
+ OSL_TRACE( "Failure from SQLFreeHandle for connection, %s:%i"
+ , __FILE__, __LINE__
+ );
+
+ m_aConnectionHandle = SQL_NULL_HANDLE;
+ }
m_pDriver->release();
m_pDriver = NULL;