diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-08-27 21:32:39 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-08-28 10:01:11 +0000 |
commit | 45e01be11111213f689ba5f1fa319e3dc48ea9c5 (patch) | |
tree | b90c7eee32baf97acd2f62b4a7ae20d199d548fe /connectivity/source/drivers/calc/CConnection.cxx | |
parent | 5bdea25f681fb252967f99a22a38cce6be3c0b48 (diff) |
Resolves: tdf#81883 dispose OCalcConnection's doc before shutdown
if noone else does it, then ensure the doc is disposed before
XDesktop it torn down
Change-Id: I3136802a40c9cfb43039307dc65949d3264b6f2b
Reviewed-on: https://gerrit.libreoffice.org/28428
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'connectivity/source/drivers/calc/CConnection.cxx')
-rw-r--r-- | connectivity/source/drivers/calc/CConnection.cxx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/connectivity/source/drivers/calc/CConnection.cxx b/connectivity/source/drivers/calc/CConnection.cxx index 3934fd4c2861..a315bc6b7c45 100644 --- a/connectivity/source/drivers/calc/CConnection.cxx +++ b/connectivity/source/drivers/calc/CConnection.cxx @@ -31,7 +31,6 @@ #include "calc/CPreparedStatement.hxx" #include "calc/CStatement.hxx" #include <unotools/pathoptions.hxx> -#include <unotools/closeveto.hxx> #include <connectivity/dbexception.hxx> #include <cppuhelper/exc_hlp.hxx> #include <comphelper/processfactory.hxx> @@ -164,7 +163,8 @@ Reference< XSpreadsheetDocument> const & OCalcConnection::acquireDoc() ::dbtools::throwGenericSQLException( sError, *this, aErrorDetails ); } osl_atomic_increment(&m_nDocCount); - m_pCloseListener.reset(new utl::CloseVeto(m_xDoc, true)); + m_xCloseVetoButTerminateListener.set(new CloseVetoButTerminateListener); + m_xCloseVetoButTerminateListener->start(m_xDoc, xDesktop); return m_xDoc; } @@ -172,7 +172,11 @@ void OCalcConnection::releaseDoc() { if ( osl_atomic_decrement(&m_nDocCount) == 0 ) { - m_pCloseListener.reset(); // dispose m_xDoc + if (m_xCloseVetoButTerminateListener.is()) + { + m_xCloseVetoButTerminateListener->stop(); // dispose m_xDoc + m_xCloseVetoButTerminateListener.clear(); + } m_xDoc.clear(); } } @@ -182,7 +186,11 @@ void OCalcConnection::disposing() ::osl::MutexGuard aGuard(m_aMutex); m_nDocCount = 0; - m_pCloseListener.reset(); // dispose m_xDoc + if (m_xCloseVetoButTerminateListener.is()) + { + m_xCloseVetoButTerminateListener->stop(); // dispose m_xDoc + m_xCloseVetoButTerminateListener.clear(); + } m_xDoc.clear(); OConnection::disposing(); |