From f0c49bd1554885ed601ae9a9507a5689b2cc7914 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 24 Oct 2024 19:40:35 +0100 Subject: cid#1633781 Initialization or destruction ordering is unspecified MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit and cid#1633780 Initialization or destruction ordering is unspecified cid#1633778 Initialization or destruction ordering is unspecified cid#1633777 Initialization or destruction ordering is unspecified cid#1633776 Initialization or destruction ordering is unspecified Change-Id: I8ae7cbede6df2ad747fe57d0ac2800e1b6a31038 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175576 Reviewed-by: Caolán McNamara Tested-by: Jenkins --- desktop/source/lib/lokclipboard.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'desktop/source') diff --git a/desktop/source/lib/lokclipboard.cxx b/desktop/source/lib/lokclipboard.cxx index 99f803523d40..c64a9ecd9cb2 100644 --- a/desktop/source/lib/lokclipboard.cxx +++ b/desktop/source/lib/lokclipboard.cxx @@ -20,7 +20,12 @@ using namespace css; using namespace css::uno; /* static */ osl::Mutex LOKClipboardFactory::gMutex; -static tools::DeleteOnDeinit>> gClipboards{}; +static tools::DeleteOnDeinit>>& getClipboards() +{ + static tools::DeleteOnDeinit>> + gClipboards{}; + return gClipboards; +} rtl::Reference LOKClipboardFactory::getClipboardForCurView() { @@ -28,6 +33,7 @@ rtl::Reference LOKClipboardFactory::getClipboardForCurView() osl::MutexGuard aGuard(gMutex); + auto& gClipboards = getClipboards(); auto it = gClipboards.get()->find(nViewId); if (it != gClipboards.get()->end()) { @@ -44,6 +50,7 @@ void LOKClipboardFactory::releaseClipboardForView(int nViewId) { osl::MutexGuard aGuard(gMutex); + auto& gClipboards = getClipboards(); if (nViewId < 0) // clear all { gClipboards.get()->clear(); -- cgit