Grab the solar mutex when deconstructing ScCondFormatsObj

SfxBroadcaster::RemoveListener asserts that the solar mutex is held so
without this LibreOffice will crash in a debug build if the object is
deconstructed in another thread such as when the last reference to it
was from an external process. The same thing is done in the other
constructors for uno objects in the same directory.

This fixes the crash mentioned at the bottom of comment #3 of
tdf#171950.

Change-Id: I881a86018a7ee88bf36d600b7f3119dd869af0d0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205947
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins
This commit is contained in:
Neil Roberts
2026-06-03 21:02:33 +02:00
parent b25618a9b0
commit 11ca379481
+2
View File
@@ -318,6 +318,8 @@ ScCondFormatsObj::ScCondFormatsObj(ScDocShell* pDocShell, SCTAB nTab):
ScCondFormatsObj::~ScCondFormatsObj()
{
SolarMutexGuard aGuard;
if (mpDocShell)
mpDocShell->GetDocument().RemoveUnoObject(*this);
}