From 8059f9bb3a8a4991a364db797965efffee2dba1d Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 1 Nov 2017 15:46:20 +0100 Subject: [PATCH] window: Clear the renderer un unrealize We disconnect from the GDK window, so the renderer can't keep any useful state. Plus, we might be using an entirely different window next time we realize (after a call to gtk_window_set_display() for example) that should use a completely different renderer anyway. --- gtk/gtkwindow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index c06b59df4d..c9716a698b 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -6995,8 +6995,8 @@ gtk_window_unrealize (GtkWidget *widget) (GtkCallback) gtk_widget_unrealize, NULL); - if (priv->renderer != NULL) - gsk_renderer_unrealize (priv->renderer); + gsk_renderer_unrealize (priv->renderer); + g_clear_object (&priv->renderer); GTK_WIDGET_CLASS (gtk_window_parent_class)->unrealize (widget);