summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-05-30 15:48:49 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-05-30 15:55:00 +0200
commitc9f5e9b70968ab3f6990a47f5c98e55bcc87650d (patch)
tree8cea37cfb66911406ce68268eec3f0711f298f88 /connectivity
parent63405c050050b4f2ea2ba922e7031e2c0b5d3621 (diff)
Fix memory leak
Change-Id: I70522657f968ed4f84e9447dd999d8be746fc973
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/mork/MResultSet.cxx8
-rw-r--r--connectivity/source/drivers/mork/MResultSet.hxx1
2 files changed, 3 insertions, 6 deletions
diff --git a/connectivity/source/drivers/mork/MResultSet.cxx b/connectivity/source/drivers/mork/MResultSet.cxx
index d88f7845774f..95aa7d56a1d0 100644
--- a/connectivity/source/drivers/mork/MResultSet.cxx
+++ b/connectivity/source/drivers/mork/MResultSet.cxx
@@ -103,7 +103,6 @@ OResultSet::OResultSet(OCommonStatement* pStmt, const ::boost::shared_ptr< conne
,m_nParamIndex(0)
,m_bIsAlwaysFalseQuery(false)
,m_pKeySet(NULL)
- ,m_pSortIndex(NULL)
,m_nNewRow(0)
,m_nUpdatedRow(0)
,m_RowStates(0)
@@ -1266,7 +1265,7 @@ void SAL_CALL OResultSet::executeQuery() throw( ::com::sun::star::sdbc::SQLExcep
OSL_ENSURE( m_aQueryHelper.queryComplete(), "Query not complete!!");
- m_pSortIndex = new OSortIndex(eKeyType,m_aOrderbyAscending);
+ OSortIndex aSortIndex(eKeyType,m_aOrderbyAscending);
OSL_TRACE("OrderbyColumnNumber->size() = %zu",m_aOrderbyColumnNumber.size());
#if OSL_DEBUG_LEVEL > 0
@@ -1287,17 +1286,16 @@ void SAL_CALL OResultSet::executeQuery() throw( ::com::sun::star::sdbc::SQLExcep
pKeyValue->pushKey(new ORowSetValueDecorator(value));
}
- m_pSortIndex->AddKeyValue( pKeyValue );
+ aSortIndex.AddKeyValue( pKeyValue );
}
- m_pKeySet = m_pSortIndex->CreateKeySet();
+ m_pKeySet = aSortIndex.CreateKeySet();
m_CurrentRowCount = static_cast<sal_Int32>(m_pKeySet->get().size());
#if OSL_DEBUG_LEVEL > 0
for( OKeySet::Vector::size_type i = 0; i < m_pKeySet->get().size(); i++ )
OSL_TRACE("Sorted: %d -> %d", i, (m_pKeySet->get())[i] );
#endif
- m_pSortIndex = NULL;
beforeFirst(); // Go back to start
}
else //we always need m_pKeySet now
diff --git a/connectivity/source/drivers/mork/MResultSet.hxx b/connectivity/source/drivers/mork/MResultSet.hxx
index f6bb8dca0703..1126ef7d73e1 100644
--- a/connectivity/source/drivers/mork/MResultSet.hxx
+++ b/connectivity/source/drivers/mork/MResultSet.hxx
@@ -237,7 +237,6 @@ protected:
sal_Int32 m_nParamIndex;
bool m_bIsAlwaysFalseQuery;
::rtl::Reference<OKeySet> m_pKeySet;
- OSortIndex* m_pSortIndex;
sal_Int32 m_nNewRow; //inserted row
sal_Int32 m_nUpdatedRow; //updated row
sal_Int32 m_RowStates;