summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorAntonio Fernandez <antonio.fernandez@aentos.es>2012-09-19 20:05:56 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2012-11-14 13:52:49 +0100
commitea2261fac59fde0129bcdafb3e8f8ee94afc635f (patch)
tree75730ac9d05540b2bbc9db7c3a8e1d63060e155f /vcl
parente53963cb8ae0316ff5cab87d7c1a9c86e0785412 (diff)
Fixed a crash updating the menu after opening an application from main screen.
Change-Id: If7b603dca5aa33e50a63e04fda3bce594840cc57
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/gtk/window/gtksalmenu.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/vcl/unx/gtk/window/gtksalmenu.cxx b/vcl/unx/gtk/window/gtksalmenu.cxx
index fe3b4cdc4e59..60942a5dc218 100644
--- a/vcl/unx/gtk/window/gtksalmenu.cxx
+++ b/vcl/unx/gtk/window/gtksalmenu.cxx
@@ -130,6 +130,8 @@ static void UpdateNativeMenu2( GtkSalMenu *pMenu )
if ( pSubmenu && pSubmenu->GetMenu() )
{
+ pMenu->NativeSetItemCommand( nSection, nItemPos, nId, aNativeCommand, itemBits, FALSE, TRUE );
+
GLOMenu* pSubMenuModel = g_lo_menu_get_submenu_from_item_in_section( pLOMenu, nSection, nItemPos );
if ( pSubMenuModel == NULL )
@@ -138,7 +140,8 @@ static void UpdateNativeMenu2( GtkSalMenu *pMenu )
g_lo_menu_set_submenu_to_item_in_section( pLOMenu, nSection, nItemPos, G_MENU_MODEL( pSubMenuModel ) );
}
- pMenu->NativeSetItemCommand( nSection, nItemPos, nId, aNativeCommand, itemBits, FALSE, TRUE );
+ g_object_unref( pSubMenuModel );
+
pSubmenu->SetMenuModel( G_MENU_MODEL( pSubMenuModel ) );
pSubmenu->SetActionGroup( pActionGroup );
}
@@ -230,6 +233,8 @@ static void UpdateNativeMenu( GtkSalMenu* pMenu )
if ( pSubmenu && pSubmenu->GetMenu() )
{
+ pMenu->NativeSetItemCommand( nSection, nItemPos, nId, aNativeCommand, itemBits, FALSE, TRUE );
+
GLOMenu* pSubMenuModel = g_lo_menu_get_submenu_from_item_in_section( pLOMenu, nSection, nItemPos );
if ( pSubMenuModel == NULL )
@@ -238,7 +243,7 @@ static void UpdateNativeMenu( GtkSalMenu* pMenu )
g_lo_menu_set_submenu_to_item_in_section( pLOMenu, nSection, nItemPos, G_MENU_MODEL( pSubMenuModel ) );
}
- pMenu->NativeSetItemCommand( nSection, nItemPos, nId, aNativeCommand, itemBits, FALSE, TRUE );
+ g_object_unref( pSubMenuModel );
pSubmenu->GetMenu()->Activate();
pSubmenu->GetMenu()->Deactivate();