summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--connectivity/source/drivers/macab/MacabConnection.cxx14
-rw-r--r--connectivity/source/drivers/macab/MacabConnection.hxx5
2 files changed, 17 insertions, 2 deletions
diff --git a/connectivity/source/drivers/macab/MacabConnection.cxx b/connectivity/source/drivers/macab/MacabConnection.cxx
index e52edf085412..4e5a27354e54 100644
--- a/connectivity/source/drivers/macab/MacabConnection.cxx
+++ b/connectivity/source/drivers/macab/MacabConnection.cxx
@@ -46,8 +46,8 @@ MacabConnection::MacabConnection(MacabDriver* _pDriver)
MacabConnection::~MacabConnection()
{
- if (!isClosed())
- close();
+ if (!doIsClosed())
+ doClose();
m_pDriver->release();
m_pDriver = nullptr;
@@ -140,6 +140,11 @@ void SAL_CALL MacabConnection::rollback( )
sal_Bool SAL_CALL MacabConnection::isClosed( )
{
+ return doIsClosed();
+}
+
+bool MacabConnection::doIsClosed()
+{
::osl::MutexGuard aGuard( m_aMutex );
// just simple -> we are closed when we are disposed, that means someone called dispose(); (XComponent)
@@ -235,6 +240,11 @@ void SAL_CALL MacabConnection::setTypeMap( const Reference< css::container::XNam
// XCloseable
void SAL_CALL MacabConnection::close( )
{
+ doClose();
+}
+
+void MacabConnection::doClose()
+{
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(MacabConnection_BASE::rBHelper.bDisposed);
diff --git a/connectivity/source/drivers/macab/MacabConnection.hxx b/connectivity/source/drivers/macab/MacabConnection.hxx
index 1cfb692ec18e..6173b26dc5f4 100644
--- a/connectivity/source/drivers/macab/MacabConnection.hxx
+++ b/connectivity/source/drivers/macab/MacabConnection.hxx
@@ -58,6 +58,11 @@ namespace connectivity
css::uno::Reference< css::sdbcx::XTablesSupplier>
m_xCatalog; // needed for the SQL interpreter
+ private:
+ bool doIsClosed();
+
+ void doClose();
+
public:
/// @throws css::sdbc::SQLException
virtual void construct( const OUString& url,const css::uno::Sequence< css::beans::PropertyValue >& info);