[Libreoffice-commits] core.git: framework/source
Michael Stahl
mstahl at redhat.com
Thu Sep 15 13:52:12 UTC 2016
framework/source/services/autorecovery.cxx | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
New commits:
commit 437377bbda0ac6b0be3c4f6fac59a4c782eecef8
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Sep 15 15:11:41 2016 +0200
tdf#101771 framework: avoid deadlock in AutoRecovery
AutoRecovery::implts_updateModifiedState() should call external
functions like isModified() before acquiring its own mutex.
(regression from 403eefe81b8a0afe888c60452c17d6b2c5d8343f)
Change-Id: Iae56eec2b6f392b7a7f65a5f54c73efa746263d0
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index 76033d8..a4687b3 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -2593,6 +2593,12 @@ void AutoRecovery::implts_markDocumentModifiedAgainstLastBackup(const css::uno::
void AutoRecovery::implts_updateModifiedState(const css::uno::Reference< css::frame::XModel >& xDocument)
{
+ // use true as fallback to get every document on EmergencySave/AutoRecovery!
+ bool bModified = true;
+ css::uno::Reference< css::util::XModifiable > xModify(xDocument, css::uno::UNO_QUERY);
+ if (xModify.is())
+ bModified = xModify->isModified();
+
CacheLockGuard aCacheLock(this, cppu::WeakComponentImplHelperBase::rBHelper.rMutex, m_nDocCacheLock, LOCK_FOR_CACHE_USE);
/* SAFE */ {
@@ -2603,11 +2609,6 @@ void AutoRecovery::implts_updateModifiedState(const css::uno::Reference< css::fr
{
AutoRecovery::TDocumentInfo& rInfo = *pIt;
- // use sal_True as fallback ... so we recognize every document on EmergencySave/AutoRecovery!
- bool bModified = true;
- css::uno::Reference< css::util::XModifiable > xModify(xDocument, css::uno::UNO_QUERY);
- if (xModify.is())
- bModified = xModify->isModified();
if (bModified)
{
rInfo.DocumentState |= AutoRecovery::E_MODIFIED;
More information about the Libreoffice-commits
mailing list