summaryrefslogtreecommitdiffstats
path: root/vcl/unx/gtk3/gtksalmenu.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/unx/gtk3/gtksalmenu.cxx')
-rw-r--r--vcl/unx/gtk3/gtksalmenu.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/vcl/unx/gtk3/gtksalmenu.cxx b/vcl/unx/gtk3/gtksalmenu.cxx
index a510473650..ddfa5ef36b 100644
--- a/vcl/unx/gtk3/gtksalmenu.cxx
+++ b/vcl/unx/gtk3/gtksalmenu.cxx
@@ -125,6 +125,7 @@ static void RemoveDisabledItemsFromNativeMenu(GLOMenu* pMenu, GList** pOldComman
g_free(pSubCommand);
}
}
+ g_object_unref(pSubMenuModel);
}
}
@@ -830,6 +831,7 @@ bool GtkSalMenu::AddMenuBarButton(const SalMenuButtonItem& rNewItem)
pImage = gtk_image_new_from_gicon(pIcon);
#endif
g_object_unref(pIcon);
+ g_bytes_unref(pBytes);
}
GtkWidget* pButton = AddButton(pImage);
@@ -1361,7 +1363,8 @@ bool GtkSalMenu::NativeSetItemCommand( unsigned nSection,
if ( aCurrentCommand == nullptr || g_strcmp0( aCurrentCommand, aCommand ) != 0 )
{
- bool bOldHasSubmenu = g_lo_menu_get_submenu_from_item_in_section(pMenu, nSection, nItemPos) != nullptr;
+ GLOMenu* pSubMenuModel = g_lo_menu_get_submenu_from_item_in_section(pMenu, nSection, nItemPos);
+ bool bOldHasSubmenu = pSubMenuModel != nullptr;
bSubMenuAddedOrRemoved = bOldHasSubmenu != bIsSubmenu;
if (bSubMenuAddedOrRemoved)
{
@@ -1385,6 +1388,8 @@ bool GtkSalMenu::NativeSetItemCommand( unsigned nSection,
g_lo_menu_set_action_and_target_value_to_item_in_section( pMenu, nSection, nItemPos, aItemCommand, pTarget );
pTarget = nullptr;
}
+ if (bOldHasSubmenu)
+ g_object_unref(pSubMenuModel);
g_free( aItemCommand );
}