diff --git a/vcl/source/window/dndevdis.cxx b/vcl/source/window/dndevdis.cxx index 050b74983766..20476e3a2c90 100644 --- a/vcl/source/window/dndevdis.cxx +++ b/vcl/source/window/dndevdis.cxx @@ -413,8 +413,7 @@ sal_Int32 DNDEventDispatcher::fireDropEvent( vcl::Window *pWindow, Reference< XDropTarget > xDropTarget = pWindow->GetDropTarget(); // window may be destroyed in drop event handler - ImplDelData aDelData; - pWindow->ImplAddDel( &aDelData ); + VclPtr xWindow = pWindow; if( xDropTarget.is() ) { @@ -426,9 +425,8 @@ sal_Int32 DNDEventDispatcher::fireDropEvent( vcl::Window *pWindow, xContext, nDropAction, relLoc.X(), relLoc.Y(), nSourceActions, xTransferable ); } - if ( !aDelData.IsDead() ) + if ( xWindow->IsDisposed() ) { - pWindow->ImplRemoveDel( &aDelData ); // release UI lock pWindow->DecrementLockCount(); }