[Libreoffice-commits] core.git: fpicker/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Jan 25 15:04:53 UTC 2019
fpicker/source/win32/VistaFilePickerEventHandler.cxx | 1 +
fpicker/source/win32/asyncrequests.cxx | 9 ++++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
New commits:
commit 5b2f1243bd44b450da26c8344b3ee459f8e88f6c
Author: Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Fri Jan 25 10:05:36 2019 +0000
Commit: Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Fri Jan 25 16:04:25 2019 +0100
tdf#122927 prevent SolarMutex deadlock on join()
The AsyncRequests thread can be blocked in a SolarMutexGuard, so
we have to release the mutex before calling join().
But there is also a static AsyncRequests object inside the
VistaFilePickerEventHandler::impl_sendEvent function, which will
just be cleaned up at DLL atexit.
"Luckily" it won't ever run, so it doesn't need to be joined and
we can use isRunning to detect it, prevent releasing a non-
existing SolarMutex at this point and so won't crash LO on exit.
Change-Id: I0c56b89a11f96be54e82b756c5e18a058b04a41d
Reviewed-on: https://gerrit.libreoffice.org/66901
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>
diff --git a/fpicker/source/win32/VistaFilePickerEventHandler.cxx b/fpicker/source/win32/VistaFilePickerEventHandler.cxx
index 0bf9165f9e48..e770bef25406 100644
--- a/fpicker/source/win32/VistaFilePickerEventHandler.cxx
+++ b/fpicker/source/win32/VistaFilePickerEventHandler.cxx
@@ -289,6 +289,7 @@ public:
void VistaFilePickerEventHandler::impl_sendEvent( EEventType eEventType,
::sal_Int16 nControlID)
{
+ // See special handling in ~AsyncRequests for this static
static AsyncRequests aNotify(RequestHandlerRef(new AsyncPickerEvents()));
::cppu::OInterfaceContainerHelper* pContainer = m_lListener.getContainer( cppu::UnoType<css::ui::dialogs::XFilePickerListener>::get());
diff --git a/fpicker/source/win32/asyncrequests.cxx b/fpicker/source/win32/asyncrequests.cxx
index 766a2309d991..c7fb3f73878e 100644
--- a/fpicker/source/win32/asyncrequests.cxx
+++ b/fpicker/source/win32/asyncrequests.cxx
@@ -75,7 +75,14 @@ AsyncRequests::~AsyncRequests()
aLock.clear();
// <- SYNCHRONIZED
- join();
+ // The static AsyncRequests aNotify in VistaFilePickerEventHandler::impl_sendEvent
+ // is destructed at DLL atexit. But it won't run, so needs no join and release of
+ // the already destructed SolarMutex, which would crash LO on exit.
+ if (isRunning())
+ {
+ SolarMutexReleaser aReleaser;
+ join();
+ }
}
void AsyncRequests::triggerJobExecution()
More information about the Libreoffice-commits
mailing list