[Libreoffice-commits] core.git: 2 commits - vcl/unx

Maxim Monastirsky momonasmon at gmail.com
Thu Sep 22 09:24:44 UTC 2016


 vcl/unx/gtk/gtksalmenu.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 7acac4e5b2635f561143701c9634941293f6db14
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Thu Sep 22 03:23:01 2016 +0300

    Fix memleak in GtkSalMenu::NativeSetItemCommand
    
    Change-Id: Id952f3dc236d2dc2c6839ce75943bda162fabf82

diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx
index 0573e6c..be68eff 100644
--- a/vcl/unx/gtk/gtksalmenu.cxx
+++ b/vcl/unx/gtk/gtksalmenu.cxx
@@ -977,6 +977,7 @@ bool GtkSalMenu::NativeSetItemCommand( unsigned nSection,
             gchar* pLabel = g_lo_menu_get_label_from_item_in_section(pMenu, nSection, nItemPos);
             g_lo_menu_remove_from_section(pMenu, nSection, nItemPos);
             g_lo_menu_insert_in_section(pMenu, nSection, nItemPos, pLabel);
+            g_free(pLabel);
         }
 
         g_lo_menu_set_command_to_item_in_section( pMenu, nSection, nItemPos, aCommand );
commit 77bb1d838e1730a552346108fd608b373a05d3c8
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Thu Sep 22 03:22:33 2016 +0300

    Don't unnecessarily activate all menus in gtk2
    
    Change-Id: I9d4b4e55673f73dd6c518bb169416958fde72a32

diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx
index 8671f4c..0573e6c 100644
--- a/vcl/unx/gtk/gtksalmenu.cxx
+++ b/vcl/unx/gtk/gtksalmenu.cxx
@@ -762,7 +762,8 @@ void GtkSalMenu::SetFrame(const SalFrame* pFrame)
     }
 
     // Generate the main menu structure.
-    UpdateFull();
+    if ( PrepUpdate() )
+        UpdateFull();
 
     g_lo_menu_insert_section( pMenuModel, 0, nullptr, mpMenuModel );
 


More information about the Libreoffice-commits mailing list