summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-12-09 09:36:00 +0000
committerMichael Stahl <michael.stahl@cib.de>2020-12-10 15:35:03 +0100
commit9700c6ecc6a488247b5c504577d3599ac54d497e (patch)
treeb11f23884ad7ada5d1aa8b8c37aabadb63adfd09 /vcl
parentcce4ed9dbb9c6189b07795213aa8731baf22cd2f (diff)
unref pSubMenuModel at the end of the scope
Change-Id: Ia427c736f989de38f30c455aeed0f43811a456b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107475 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/gtk3/gtk3gtksalmenu.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/vcl/unx/gtk3/gtk3gtksalmenu.cxx b/vcl/unx/gtk3/gtk3gtksalmenu.cxx
index 262187f16658..6e47e4eae91a 100644
--- a/vcl/unx/gtk3/gtk3gtksalmenu.cxx
+++ b/vcl/unx/gtk3/gtk3gtksalmenu.cxx
@@ -325,7 +325,7 @@ void GtkSalMenu::ImplUpdate(bool bRecurse, bool bRemoveDisabledEntries)
pSubMenuModel = g_lo_menu_get_submenu_from_item_in_section( pLOMenu, nSection, nItemPos );
}
- g_object_unref( pSubMenuModel );
+ assert(pSubMenuModel);
if (bRecurse || bNonMenuChangedToMenu)
{
@@ -334,6 +334,8 @@ void GtkSalMenu::ImplUpdate(bool bRecurse, bool bRemoveDisabledEntries)
pSubmenu->SetActionGroup( G_ACTION_GROUP( pActionGroup ) );
pSubmenu->ImplUpdate(true, bRemoveDisabledEntries);
}
+
+ g_object_unref( pSubMenuModel );
}
g_free( aNativeCommand );