[gtk+] GtkPopover: Don't ref NULL widgets
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkPopover: Don't ref NULL widgets
- Date: Sun, 3 May 2015 18:04:34 +0000 (UTC)
commit c28275f4ec1d02698336aea7cffd4aabaa1e61b0
Author: Timm Bäder <mail baedert org>
Date: Sun May 3 12:19:18 2015 +0200
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.
gtk/gtkpopover.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index 49d2fc2..5c9103e 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -582,7 +582,8 @@ gtk_popover_map (GtkWidget *widget)
GtkPopoverPrivate *priv = GTK_POPOVER (widget)->priv;
priv->prev_default = gtk_window_get_default_widget (priv->window);
- g_object_ref (priv->prev_default);
+ if (priv->prev_default)
+ g_object_ref (priv->prev_default);
GTK_WIDGET_CLASS (gtk_popover_parent_class)->map (widget);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]