cid#1606905 Data race condition

Change-Id: I138cc2ef0f30ae4dcb0d86ada3a62507efc22340
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174206
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
This commit is contained in:
Caolán McNamara 2024-09-28 20:03:42 +01:00
parent eb73e2c8b6
commit 73db214e2f

View file

@ -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<XWeak*>(m_xComp.get()) )
return;
std::unique_lock aGuard( m_aMutex );
// Remove EventListener
Reference<XEventListener> xEvtLstnr = static_cast<XEventListener*>(this);
m_xComp->removeEventListener( xEvtLstnr );