diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-12-04 15:08:26 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-12-04 21:49:03 +0100 |
commit | 8472365774b7471e96a025f424a6c7eb7b02db26 (patch) | |
tree | 81cd5e196e3d9dc2f407344f75d83a259c2e87d5 /vcl/win | |
parent | 7059a1858ddb044c5f3f0c8e0386d3e1d9dd2b5f (diff) |
Avoid clipboard messages after Scheduler::ImplDeInitScheduler
When running UITests on Windows with parallelism, often there are
clipboard "content changed" messages that fail the assertion in
Scheduler::ImplDeInitScheduler. This is because the clipboard is
only uninitialized after the scheduler de-init; and even then,
the respective threads are not stopped yet.
Make sure that clipboard listeners are stopped before calling the
Scheduler::ImplDeInitScheduler in DeInitVCL.
Change-Id: I37918cdc565c7f1b3bd4f46e71c55bb5a807db6b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160308
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'vcl/win')
-rw-r--r-- | vcl/win/dtrans/WinClipboard.cxx | 12 | ||||
-rw-r--r-- | vcl/win/dtrans/WinClipboard.hxx | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/vcl/win/dtrans/WinClipboard.cxx b/vcl/win/dtrans/WinClipboard.cxx index f82c56784523..1a8eaea151b5 100644 --- a/vcl/win/dtrans/WinClipboard.cxx +++ b/vcl/win/dtrans/WinClipboard.cxx @@ -82,6 +82,18 @@ CWinClipboard::~CWinClipboard() unregisterClipboardViewer(); } +void CWinClipboard::disposing(std::unique_lock<std::mutex>& mutex) +{ + { + osl::MutexGuard aGuard(s_aClipboardSingletonMutex); + s_pCWinClipbImpl = nullptr; + } + + unregisterClipboardViewer(); + + WeakComponentImplHelper::disposing(mutex); +} + // XClipboard // to avoid unnecessary traffic we check first if there is a clipboard diff --git a/vcl/win/dtrans/WinClipboard.hxx b/vcl/win/dtrans/WinClipboard.hxx index 779c272c56c9..fbaa1b206288 100644 --- a/vcl/win/dtrans/WinClipboard.hxx +++ b/vcl/win/dtrans/WinClipboard.hxx @@ -105,6 +105,8 @@ public: virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; IDataObjectPtr getIDataObject(); + + virtual void disposing(std::unique_lock<std::mutex>&) override; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |