Guest User

Untitled

a guest
Jan 5th, 2016
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. diff --git vcl/source/window/event.cxx vcl/source/window/event.cxx
  2. index 1f3eb24..65828f4 100644
  3. --- vcl/source/window/event.cxx
  4. +++ vcl/source/window/event.cxx
  5. @@ -205,13 +205,12 @@ void Window::CallEventListeners( sal_uLong nEvent, void* pData )
  6. {
  7. VclWindowEvent aEvent( this, nEvent, pData );
  8.  
  9. - ImplDelData aDelData;
  10. - ImplAddDel( &aDelData );
  11. + VclPtr<vcl::Window> xWindow = this;
  12.  
  13. Application::ImplCallEventListeners( aEvent );
  14.  
  15. - if ( aDelData.IsDead() )
  16. - return;
  17. + if( xWindow->IsDisposed() )
  18. + return;
  19.  
  20. if (!mpWindowImpl->maEventListeners.empty())
  21. {
  22. @@ -219,25 +218,26 @@ void Window::CallEventListeners( sal_uLong nEvent, void* pData )
  23. std::vector<Link<VclWindowEvent&,void>> aCopy( mpWindowImpl->maEventListeners );
  24. for ( Link<VclWindowEvent&,void>& rLink : aCopy )
  25. {
  26. - if (aDelData.IsDead()) break;
  27. + if( xWindow->IsDisposed() )break;
  28. // check this hasn't been removed in some re-enterancy scenario fdo#47368
  29. if( std::find(mpWindowImpl->maEventListeners.begin(), mpWindowImpl->maEventListeners.end(), rLink) != mpWindowImpl->maEventListeners.end() )
  30. rLink.Call( aEvent );
  31. }
  32. }
  33.  
  34. - if ( aDelData.IsDead() )
  35. - return;
  36. + if( xWindow->IsDisposed() )
  37. + return;
  38.  
  39. - ImplRemoveDel( &aDelData );
  40. + xWindow.clear();
  41. + xWindow.reset();
  42.  
  43. vcl::Window* pWindow = this;
  44. while ( pWindow )
  45. {
  46. - pWindow->ImplAddDel( &aDelData );
  47. + xWindow = pWindow;
  48.  
  49. - if ( aDelData.IsDead() )
  50. - return;
  51. + if( xWindow->IsDisposed() )
  52. + return;
  53.  
  54. auto& rWindowImpl = *pWindow->mpWindowImpl;
  55. if (!rWindowImpl.maChildEventListeners.empty())
  56. @@ -256,18 +256,19 @@ void Window::CallEventListeners( sal_uLong nEvent, void* pData )
  57. );
  58. for ( Link<VclWindowEvent&,void>& rLink : aCopy )
  59. {
  60. - if (aDelData.IsDead())
  61. - return;
  62. + if( xWindow->IsDisposed() )
  63. + return;
  64. // Check this hasn't been removed in some re-enterancy scenario fdo#47368.
  65. if( rWindowImpl.maChildEventListenersDeleted.find(rLink) == rWindowImpl.maChildEventListenersDeleted.end() )
  66. rLink.Call( aEvent );
  67. }
  68. }
  69.  
  70. - if ( aDelData.IsDead() )
  71. - return;
  72. + if( xWindow->IsDisposed() )
  73. + return;
  74.  
  75. - pWindow->ImplRemoveDel( &aDelData );
  76. + xWindow.clear();
  77. + xWindow.reset();
  78.  
  79. pWindow = pWindow->GetParent();
  80. }
Add Comment
Please, Sign In to add comment