summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-01-27 12:16:59 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-01-27 15:02:43 +0100
commitc072bd1df9bd01b34b99fbff50ee09bd5f5ac6ee (patch)
treedf112c52ee8488a693100addd36d73064930ce14
parent5cb69b6653097b0772e112f0979fc9ee7da18fa8 (diff)
Lock SolarMutex around fmFormShell::DetermineForms calls
At least in JunitTest_forms_unoapi there are calls via URP of SfxShell::UIFeatureChanged FmFormShell::DetermineForms FmXFormShell::elementInserted cppu::OInterfaceContainerHelper::NotifySingleListener<...>::operator() cppu::OInterfaceContainerHelper::forEach<...> cppu::OInterfaceContainerHelper::notifyEach<...> frm::OInterfaceContainer::implInsert frm::OInterfaceContainer::insertByName frm::OFormsCollection::insertByName ... where SfxShell::UIFeatureChanged does an svtools::AsynchronLink::Call, and there are notorious crashes during JunitTest_forms_unoapi in vcl::Window::ImplRemoveDel Application::RemoveUserEvent svtools::AsynchronLink::~AsynchronLink SfxShell_Impl::~SfxShell_Impl SfxShell::~SfxShell FmFomrShell::~FmFormShell ... and the naive hope is that the former's unlocked operations cause some corruption that make the latter operate on a dangling AsynchronLink::_nEventId. (As always, the question is at which level to lock the solar mutex; frm::OFormsCollection et al appear to be properly mutex'ed, FmXFormShell appears to be virtually un-mutex'ed, except for some smelly m_aInvalidationSafety and m_aAsyncSafety, and FmFormShell and SfxShell appear to run under the assumption that the solar mutex is always locked. So stick the guards into FmXFormShell--- which is the only place calling DetermineForms---under the assumption that that is the most likely place needing general mutex clean-up in the future, and thus bears the highest chance the potentially becoming redundant guards will be noticed again.) Change-Id: Iad0f4bd9af2bf62330e26ac50edd170f470e79c4
-rw-r--r--svx/source/form/fmshimp.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index 3ba69ccd7c1b..e76c4f11bfce 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -2548,6 +2548,8 @@ void FmXFormShell::elementInserted(const ContainerEvent& evt) throw(::com::sun::
Reference< XInterface> xTemp;
evt.Element >>= xTemp;
AddElement(xTemp);
+
+ SolarMutexGuard g;
m_pShell->DetermineForms(true);
}
@@ -2573,6 +2575,8 @@ void FmXFormShell::elementRemoved(const ContainerEvent& evt) throw(::com::sun::s
Reference< XInterface> xTemp;
evt.Element >>= xTemp;
RemoveElement(xTemp);
+
+ SolarMutexGuard g;
m_pShell->DetermineForms(true);
}
@@ -2598,6 +2602,7 @@ void FmXFormShell::UpdateForms( bool _bInvalidate )
AddElement( m_xForms );
}
+ SolarMutexGuard g;
m_pShell->DetermineForms( _bInvalidate );
}