diff options
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/dndlistenercontainer.cxx | 11 |
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( ) |