From 7ecd3378771f2aab230cd53f191ff4f6b9474699 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Tue, 27 Sep 2016 14:09:02 -0700 Subject: [PATCH] entry: handle NULL cursor when releasing reference If we happen to have gotten NULL back for a cursor, then we need to check before unreffing it. --- gtk/gtkentry.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 35f9e691a4..cfe79a7076 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -3364,7 +3364,7 @@ gtk_entry_realize (GtkWidget *widget) gtk_widget_register_window (widget, priv->text_area); if (attributes_mask & GDK_WA_CURSOR) - g_object_unref (attributes.cursor); + g_clear_object (&attributes.cursor); gtk_im_context_set_client_window (priv->im_context, priv->text_area);