From 974ea67a7c345a8be98c5aaa59baf9b07959b708 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 10 Jan 2020 17:23:44 +0100 Subject: tdf#129930: Dispose SystemClipboard service early enough At least on Windows, the related CMtaOleClipboard::m_hClipboardChangedNotifierThread thread would otherwise still run during cppuhelper::ServiceManager::disposing (but could try to create other UNO services, which then throws a DeploymentException). (There is also a GetSystemPrimarySelection similar to GetSystemClipboard in include/vcl/transfer.hxx, which might or might not turn out to have a similar issue.) Change-Id: Ia64e708cf0578e3a127c1a56fbace577ecf4ee1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86558 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- vcl/source/app/svmain.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'vcl/source/app/svmain.cxx') diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index ace085e89632..bfa5279ca4ca 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -484,6 +484,15 @@ void DeInitVCL() pSVData->maCtrlData.mpDisclosureMinus.reset(); pSVData->mpDefaultWin.disposeAndClear(); +#if defined _WIN32 + // See GetSystemClipboard (vcl/source/treelist/transfer2.cxx): + if (auto const comp = css::uno::Reference( + pSVData->m_xSystemClipboard, css::uno::UNO_QUERY)) + { + comp->dispose(); + } +#endif + #ifndef NDEBUG DbgGUIDeInitSolarMutexCheck(); #endif -- cgit