From eb227657d91c94f151434434e31087ae74efdd24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 26 Sep 2024 08:48:56 +0100 Subject: [PATCH] cid#1608414 Double lock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit since: commit f3e127217d8daa443b8eda52ac4810e375cc7d63 CommitDate: Wed May 10 13:28:09 2023 +0200 use comphelper::WeakComponentImplHelper in DocumentEventNotifier::Impl problem: 108 std::unique_lock aGuard(m_aMutex); 109 if ( !impl_isDisposed_nothrow(aGuard) ) 110 { 111 acquire(); CID 1608414: (#1 of 1): Double lock (LOCK) 4. double_lock: dispose locks this->m_aMutex while it is locked.[show details] 112 dispose(); /include/comphelper/compbase.hxx 73 virtual void SAL_CALL dispose() noexcept final override 74 { 1. lock: dispose locks this->m_aMutex.[show details] 75 WeakComponentImplHelperBase::dispose(); /comphelper/source/misc/compbase.cxx 20 void SAL_CALL WeakComponentImplHelperBase::dispose() 21 { 1. lock: unique_lock locks this->m_aMutex. 22 std::unique_lock aGuard(m_aMutex); Change-Id: Ibd9dc0564adf86c6409794f584a743aecd9d36e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173970 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- basctl/source/basicide/doceventnotifier.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/basctl/source/basicide/doceventnotifier.cxx b/basctl/source/basicide/doceventnotifier.cxx index 254c719bb5cc..9d408d7f967a 100644 --- a/basctl/source/basicide/doceventnotifier.cxx +++ b/basctl/source/basicide/doceventnotifier.cxx @@ -109,6 +109,7 @@ namespace basctl if ( !impl_isDisposed_nothrow(aGuard) ) { acquire(); + aGuard.unlock(); // dispose locks m_aMutex dispose(); } }