[Libreoffice-commits] core.git: vcl/source

Jan-Marek Glogowski glogow at fbihome.de
Tue Nov 7 09:35:13 UTC 2017


 vcl/source/app/salusereventlist.cxx |   26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

New commits:
commit 52abd40ce879ea140b9ffe80980e5a56a09ca538
Author: Jan-Marek Glogowski <glogow at 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 <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at 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 );


More information about the Libreoffice-commits mailing list