[Libreoffice-commits] core.git: connectivity/source
Stephan Bergmann (via logerrit)
logerrit at kemper.freedesktop.org
Mon Sep 23 13:41:22 UTC 2019
connectivity/source/drivers/macab/MacabConnection.cxx | 14 ++++++++++++--
connectivity/source/drivers/macab/MacabConnection.hxx | 5 +++++
2 files changed, 17 insertions(+), 2 deletions(-)
New commits:
commit ea1d4f6ca1e6f9b7025d5ab2d8cd77139bd733ed
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Mon Sep 23 12:36:11 2019 +0200
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Mon Sep 23 15:40:20 2019 +0200
loplugin:fragiledestructor (macOS)
Change-Id: I908a7dbdb44c0b49315f0fd8559c21302dbc83a8
Reviewed-on: https://gerrit.libreoffice.org/79399
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
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);
More information about the Libreoffice-commits
mailing list