summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2024-10-03 15:59:45 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-10-03 18:44:06 +0200
commit6f7265ef036ca421654670b2b5fd59222a99ecd7 (patch)
tree277172edf5324b255181b0f12ed72032a35ac86c /vcl
parentfa58e872794f23a84e6a741f0d3074bca9f93c19 (diff)
cid#1608220 Data race condition
Change-Id: I7ff30128d663ca3524dc95ef99ef8c64dd158643 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174429 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/dndlistenercontainer.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/vcl/source/window/dndlistenercontainer.cxx b/vcl/source/window/dndlistenercontainer.cxx
index 9ff128c808bb..df8b6114f93b 100644
--- a/vcl/source/window/dndlistenercontainer.cxx
+++ b/vcl/source/window/dndlistenercontainer.cxx
@@ -384,11 +384,12 @@ sal_uInt32 DNDListenerContainer::fireDragGestureEvent( sal_Int8 dragAction, sal_
void SAL_CALL DNDListenerContainer::acceptDrag( sal_Int8 dragOperation )
{
- if( m_xDropTargetDragContext.is() )
- {
- m_xDropTargetDragContext->acceptDrag( dragOperation );
- m_xDropTargetDragContext.clear();
- }
+ std::unique_lock g(m_aMutex);
+ if( !m_xDropTargetDragContext )
+ return;
+ auto xTmpDragContext = std::move(m_xDropTargetDragContext);
+ g.unlock();
+ xTmpDragContext->acceptDrag( dragOperation );
}
void SAL_CALL DNDListenerContainer::rejectDrag( )