summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-09-15 15:11:41 +0200
committerMichael Stahl <mstahl@redhat.com>2016-09-15 15:47:10 +0200
commit437377bbda0ac6b0be3c4f6fac59a4c782eecef8 (patch)
tree43bd90337ef6fb12db9ddf63406fac3ebe549b02 /framework
parent582321c1f6509868a054afe1daf757baf2ffbe88 (diff)
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
Diffstat (limited to 'framework')
-rw-r--r--framework/source/services/autorecovery.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index 76033d84bf96..a4687b38d2b2 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;