GtkPopover: Don't ref NULL widgets

gtk_window_get_default_widget returns NULL if the window does not have a
default widget, so don't ref it in that case.
This commit is contained in:
Timm Bäder 2015-05-03 12:19:18 +02:00
parent 8c7e1f08ac
commit c28275f4ec

View File

@ -582,6 +582,7 @@ gtk_popover_map (GtkWidget *widget)
GtkPopoverPrivate *priv = GTK_POPOVER (widget)->priv;
priv->prev_default = gtk_window_get_default_widget (priv->window);
if (priv->prev_default)
g_object_ref (priv->prev_default);
GTK_WIDGET_CLASS (gtk_popover_parent_class)->map (widget);