diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-09-23 12:36:11 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-09-23 15:40:20 +0200 |
commit | ea1d4f6ca1e6f9b7025d5ab2d8cd77139bd733ed (patch) | |
tree | b420400c43073192b372cca15fe40ea116c1b84b /connectivity/source | |
parent | ffcedb264901e89dee28e12b6ccdd497a86f26f2 (diff) |
loplugin:fragiledestructor (macOS)
Change-Id: I908a7dbdb44c0b49315f0fd8559c21302dbc83a8
Reviewed-on: https://gerrit.libreoffice.org/79399
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'connectivity/source')
-rw-r--r-- | connectivity/source/drivers/macab/MacabConnection.cxx | 14 | ||||
-rw-r--r-- | connectivity/source/drivers/macab/MacabConnection.hxx | 5 |
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); |