[gtk] popovermenu: Avoid an uninitialized variable



commit 073e8dd987d0151248db72b33b5e97e004550873
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Feb 12 17:58:41 2020 -0500

    popovermenu: Avoid an uninitialized variable
    
    Pointed out by Timm/clang.
    
    Fixes https://gitlab.gnome.org/GNOME/gtk/issues/2434

 gtk/gtkpopovermenu.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/gtk/gtkpopovermenu.c b/gtk/gtkpopovermenu.c
index 6befff191f..e310033f12 100644
--- a/gtk/gtkpopovermenu.c
+++ b/gtk/gtkpopovermenu.c
@@ -148,6 +148,8 @@ gtk_popover_menu_set_active_item (GtkPopoverMenu *menu,
           gtk_widget_set_state_flags (menu->active_item, GTK_STATE_FLAG_SELECTED, FALSE);
           if (GTK_IS_MODEL_BUTTON (item))
             g_object_get (item, "popover", &popover, NULL);
+          else
+            popover = NULL;
 
           if (!popover || popover != menu->open_submenu)
             gtk_widget_grab_focus (menu->active_item);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]