diff options
author | Philipp Lohmann <pl@openoffice.org> | 2001-07-09 11:47:24 +0000 |
---|---|---|
committer | Philipp Lohmann <pl@openoffice.org> | 2001-07-09 11:47:24 +0000 |
commit | b1eab1527917c9a82d49ccc3566a62d17f56a52c (patch) | |
tree | f3e29b9f63030079e2c54a6f5867867354d8bb38 /dtrans | |
parent | 00c96e2e47132b2e700c74b990b47cde09011d63 (diff) |
#89207# fixed another deadlock and a potential SEGV
Diffstat (limited to 'dtrans')
-rw-r--r-- | dtrans/source/X11/X11_selection.cxx | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/dtrans/source/X11/X11_selection.cxx b/dtrans/source/X11/X11_selection.cxx index 46de74297c4d..cd90b6a5e1c8 100644 --- a/dtrans/source/X11/X11_selection.cxx +++ b/dtrans/source/X11/X11_selection.cxx @@ -2,9 +2,9 @@ * * $RCSfile: X11_selection.cxx,v $ * - * $Revision: 1.30 $ + * $Revision: 1.31 $ * - * last change: $Author: pl $ $Date: 2001-06-29 15:06:02 $ + * last change: $Author: pl $ $Date: 2001-07-09 12:47:24 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1093,7 +1093,8 @@ void SelectionManager::handleSelectionRequest( XSelectionRequestEvent& rRequest Reference< XDragSourceListener > xListener( m_xDragSourceListener ); m_xDragSourceListener.clear(); aGuard.clear(); - xListener->dragDropEnd( dsde ); + if( xListener.is() ) + xListener->dragDropEnd( dsde ); } } @@ -1491,9 +1492,11 @@ void SelectionManager::sendDragStatus( Atom nDropAction ) dsde.DropAction = m_nSourceActions; dsde.UserAction = m_nUserDragAction; + Reference< XDragSourceListener > xListener( m_xDragSourceListener ); // caution: do not change anything after this aGuard.clear(); - m_xDragSourceListener->dragOver( dsde ); + if( xListener.is() ) + xListener->dragOver( dsde ); } else if( m_aDropEnterEvent.data.l[0] && m_aCurrentDropWindow ) { @@ -2071,6 +2074,8 @@ void SelectionManager::updateDragWindow( int nX, int nY, Window aRoot ) { ClearableMutexGuard aGuard( m_aMutex ); + Reference< XDragSourceListener > xListener( m_xDragSourceListener ); + m_nLastDragX = nX; m_nLastDragY = nY; @@ -2152,7 +2157,8 @@ void SelectionManager::updateDragWindow( int nX, int nY, Window aRoot ) } aGuard.clear(); aSecondGuard.clear(); - m_xDragSourceListener->dragExit( dsde ); + if( xListener.is() ) + xListener->dragExit( dsde ); } ClearableMutexGuard aSecondGuard(m_aMutex); @@ -2168,7 +2174,8 @@ void SelectionManager::updateDragWindow( int nX, int nY, Window aRoot ) { aGuard.clear(); aSecondGuard.clear(); - m_xDragSourceListener->dragEnter( dsde ); + if( xListener.is() ) + xListener->dragEnter( dsde ); } ClearableMutexGuard aThirdGuard(m_aMutex); // send XdndEnter @@ -2220,7 +2227,8 @@ void SelectionManager::updateDragWindow( int nX, int nY, Window aRoot ) { aGuard.clear(); // drag over for XdndAware windows comes when receiving XdndStatus - m_xDragSourceListener->dragOver( dsde ); + if( xListener.is() ) + xListener->dragOver( dsde ); } } @@ -2409,7 +2417,9 @@ void SelectionManager::dragDoDispatch() ClearableMutexGuard aGuard(m_aMutex); Reference< XDragSourceListener > xListener( m_xDragSourceListener ); + Reference< XTransferable > xTransferable( m_xDragSourceTransferable ); m_xDragSourceListener.clear(); + m_xDragSourceTransferable.clear(); DragSourceDropEvent dsde; dsde.Source = static_cast< OWeakObject* >(this); @@ -2434,7 +2444,6 @@ void SelectionManager::dragDoDispatch() m_nNoPosHeight = 0; m_aCurrentCursor = None; - m_xDragSourceTransferable.clear(); XUngrabPointer( m_pDisplay, CurrentTime ); XUngrabKeyboard( m_pDisplay, CurrentTime ); XFlush( m_pDisplay ); @@ -2445,8 +2454,10 @@ void SelectionManager::dragDoDispatch() if( xListener.is() ) { aGuard.clear(); + xTransferable.clear(); xListener->dragDropEnd( dsde ); } + } osl_destroyThread( aThread ); } |