summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2024-01-13 18:03:53 +0100
committerAndras Timar <andras.timar@collabora.com>2024-01-15 16:27:14 +0100
commit74ec4296d8acb532c24c973dbdb8875e23172834 (patch)
treeaac806ff1b6f86c59261f56b4be632f590fabc69 /vcl
parentd600552ca6c18c9db604d1bd8fe698cd9021fc69 (diff)
Add missing g_object_unref (vcl/gtksalmenu)
Change-Id: I07db3d7a03da94b53ad49188c229c134dc2f663c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162003 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/gtk3/gtksalmenu.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/vcl/unx/gtk3/gtksalmenu.cxx b/vcl/unx/gtk3/gtksalmenu.cxx
index a510473650d6..699e0097b358 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);
}
}
@@ -1361,7 +1362,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 +1387,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 );
}