[gtk+] GtkPopover: avoid a critical



commit 4e066a750a1300aae2eb0ff7caa86cecf31ec935
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Jan 30 08:11:41 2014 -0500

    GtkPopover: avoid a critical
    
    focus_widget can be NULL, as pointed out in
    https://bugzilla.gnome.org/show_bug.cgi?id=723181#c7

 gtk/gtkpopover.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index b9dd811..378fb2c 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -246,7 +246,9 @@ gtk_popover_apply_modality (GtkPopover *popover,
       GtkWidget *prev_focus;
 
       prev_focus = gtk_window_get_focus (priv->window);
-      priv->prev_focus_widget = g_object_ref (prev_focus);
+      priv->prev_focus_widget = prev_focus;
+      if (priv->prev_focus_widget)
+        g_object_ref (prev_focus);
       gtk_grab_add (GTK_WIDGET (popover));
       gtk_widget_grab_focus (GTK_WIDGET (popover));
     }


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