diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2012-06-04 17:40:30 +0200 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2012-06-04 19:22:48 +0200 |
commit | d147ade33489509818c1a3f8cfd887a4a896381d (patch) | |
tree | 495664c29e8a644d059e559733feee0f14a9c466 /dbaccess | |
parent | 5e6a233e7bf45c426493f99d01a4b23d8ce94034 (diff) |
Cleanup m_xSet in destructor
Change-Id: I3d7023fcb1857da1ef107a8af0d373b9ca464f03
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/core/api/KeySet.cxx | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 27b2b2866212..f2dd347d6be7 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -94,6 +94,22 @@ namespace } } } + + template < typename T > inline void tryDispose( Reference<T> &r ) + { + try + { + ::comphelper::disposeComponent(r); + } + catch(const Exception&) + { + r = NULL; + } + catch(...) + { + OSL_FAIL("Unknown Exception occurred"); + } + } } DBG_NAME(OKeySet) @@ -124,18 +140,9 @@ OKeySet::OKeySet(const connectivity::OSQLTable& _xTable, OKeySet::~OKeySet() { - try - { - ::comphelper::disposeComponent(m_xStatement); - } - catch(const Exception&) - { - m_xStatement = NULL; - } - catch(...) - { - OSL_FAIL("Unknown Exception occurred"); - } + tryDispose(m_xStatement); + tryDispose(m_xSet); + m_xComposer = NULL; DBG_DTOR(OKeySet,NULL); |