vcl/source/app/salusereventlist.cxx | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-)
New commits: commit 52abd40ce879ea140b9ffe80980e5a56a09ca538 Author: Jan-Marek Glogowski <glo...@fbihome.de> Date: Sat Nov 4 22:30:30 2017 +0000 Fix memory leak for skipped Sal user events User SalEvents allocate an ImplSVEvent data structure, which must be freed in DispatchUserEvents, if it's skipped. Change-Id: I17874f06a2da996b6546b14dd886061e3e81f35c Reviewed-on: https://gerrit.libreoffice.org/44370 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/source/app/salusereventlist.cxx b/vcl/source/app/salusereventlist.cxx index 52154ec8d2eb..a3b77ecc2c19 100644 --- a/vcl/source/app/salusereventlist.cxx +++ b/vcl/source/app/salusereventlist.cxx @@ -22,6 +22,8 @@ #include <algorithm> +#include <svdata.hxx> + SalUserEventList::SalUserEventList() : m_bAllUserEventProcessedSignaled( true ) { @@ -77,17 +79,21 @@ bool SalUserEventList::DispatchUserEvents( bool bHandleAllCurrentEvents ) m_aProcessingUserEvents.pop_front(); } - if ( isFrameAlive( aEvent.m_pFrame ) ) + if ( !isFrameAlive( aEvent.m_pFrame ) ) + { + if ( aEvent.m_nEvent == SalEvent::UserEvent ) + delete static_cast< ImplSVEvent* >( aEvent.m_pData ); + continue; + } + + try + { + ProcessEvent( aEvent ); + } + catch (...) { - try - { - ProcessEvent( aEvent ); - } - catch (...) - { - SAL_WARN( "vcl", "Uncaught exception during ProcessEvent!" ); - std::abort(); - } + SAL_WARN( "vcl", "Uncaught exception during ProcessEvent!" ); + std::abort(); } } while( true );
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits