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 <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Jan-Marek Glogowski
2017-11-04 22:30:30 +00:00
committed by Caolán McNamara
parent 33021ea5c6
commit 52abd40ce8

View File

@@ -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 ) )
{
try
{
ProcessEvent( aEvent );
}
catch (...)
{
SAL_WARN( "vcl", "Uncaught exception during ProcessEvent!" );
std::abort();
}
if ( aEvent.m_nEvent == SalEvent::UserEvent )
delete static_cast< ImplSVEvent* >( aEvent.m_pData );
continue;
}
try
{
ProcessEvent( aEvent );
}
catch (...)
{
SAL_WARN( "vcl", "Uncaught exception during ProcessEvent!" );
std::abort();
}
}
while( true );