diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-12-09 09:36:00 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-12-09 13:02:43 +0100 |
commit | a0f5e32443296e7404b7646f3fc7a79ab1328399 (patch) | |
tree | db7ebe79865bb572cd277e395494f67f50814fb3 | |
parent | 0ac7c94595fca65610a3815fa6371029fc341e2c (diff) |
unref pSubMenuModel at the end of the scope
Change-Id: Ia427c736f989de38f30c455aeed0f43811a456b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107474
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | vcl/unx/gtk3/gtk3gtksalmenu.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/vcl/unx/gtk3/gtk3gtksalmenu.cxx b/vcl/unx/gtk3/gtk3gtksalmenu.cxx index bd15de7de848..f78bbab0081f 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 ); |