From 73db214e2f4f15c068d4e946ab0face6d0420199 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sat, 28 Sep 2024 20:03:42 +0100 Subject: [PATCH] cid#1606905 Data race condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I138cc2ef0f30ae4dcb0d86ada3a62507efc22340 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174206 Reviewed-by: Caolán McNamara Tested-by: Jenkins --- forms/source/component/EventThread.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/forms/source/component/EventThread.cxx b/forms/source/component/EventThread.cxx index 2d5336fe384b..62b0af091c8f 100644 --- a/forms/source/component/EventThread.cxx +++ b/forms/source/component/EventThread.cxx @@ -76,11 +76,11 @@ void OComponentEventThread::impl_clearEventQueue() void OComponentEventThread::disposing( const EventObject& evt ) { + std::unique_lock aGuard( m_aMutex ); + if( evt.Source != static_cast(m_xComp.get()) ) return; - std::unique_lock aGuard( m_aMutex ); - // Remove EventListener Reference xEvtLstnr = static_cast(this); m_xComp->removeEventListener( xEvtLstnr );