summaryrefslogtreecommitdiff
path: root/sc/source/ui/unoobj/nameuno.cxx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-09-30 14:35:11 +0200
committerMichael Stahl <mstahl@redhat.com>2014-09-30 17:34:25 +0200
commit3a218acef4004d8f4dc53bf904127b2a7de3f96a (patch)
treefa5e26103546487badab21248bf9e9d3ffc43ac2 /sc/source/ui/unoobj/nameuno.cxx
parentbc8a11cf663c41fbe3245640a6159bd0ea6d9ce7 (diff)
sc: lock SolarMutex before calling ScDocument::RemoveUnoObject()
This can race against other threads calling AddUnoObject(), and hopefully this should fix the assert from SfxBroadcaster::AddListener() line 96 that has been observed in sc_unoapi. Change-Id: Ia2dd38a499c51a77c54cffe9dde31e14053ae0e5
Diffstat (limited to 'sc/source/ui/unoobj/nameuno.cxx')
-rw-r--r--sc/source/ui/unoobj/nameuno.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx
index 4989cd07a6da..8fe14eb1b237 100644
--- a/sc/source/ui/unoobj/nameuno.cxx
+++ b/sc/source/ui/unoobj/nameuno.cxx
@@ -92,6 +92,8 @@ ScNamedRangeObj::ScNamedRangeObj( rtl::Reference< ScNamedRangesObj > xParent, Sc
ScNamedRangeObj::~ScNamedRangeObj()
{
+ SolarMutexGuard g;
+
if (pDocShell)
pDocShell->GetDocument().RemoveUnoObject(*this);
}
@@ -473,6 +475,8 @@ ScNamedRangesObj::ScNamedRangesObj(ScDocShell* pDocSh) :
ScNamedRangesObj::~ScNamedRangesObj()
{
+ SolarMutexGuard g;
+
if (pDocShell)
pDocShell->GetDocument().RemoveUnoObject(*this);
}
@@ -935,6 +939,8 @@ ScLabelRangeObj::ScLabelRangeObj(ScDocShell* pDocSh, bool bCol, const ScRange& r
ScLabelRangeObj::~ScLabelRangeObj()
{
+ SolarMutexGuard g;
+
if (pDocShell)
pDocShell->GetDocument().RemoveUnoObject(*this);
}
@@ -1054,6 +1060,8 @@ ScLabelRangesObj::ScLabelRangesObj(ScDocShell* pDocSh, bool bCol) :
ScLabelRangesObj::~ScLabelRangesObj()
{
+ SolarMutexGuard g;
+
if (pDocShell)
pDocShell->GetDocument().RemoveUnoObject(*this);
}