Prevent Gtk-CRITICAL when unrealize-ing a GtkPaned.

This commit fixes a bug (issue #2066) caused by gdk_window_set_cursor being called with a NULL pointer as its first argument during the
unrealize-ing of a GtkPaned, resulting in a Gtk-CRITICAL. The change ensures that, even if the function gtk_paned_state_flags_changed
is called on a GtkPaned while it is part way through being unrealized (as can happen, for example, if a descendant of the GtkPaned calls
gtk_clipboard_store when it is unrealize-d, see the issue report for a test case), the function gdk_window_set_cursor is not called on
the GtkPaned's priv->handle member if this pointer is NULL.

Closes #2066
Fixes #2066
Closes: https://gitlab.gnome.org/GNOME/gtk/issues/2066
This commit is contained in:
Reuben Green 2019-07-30 18:50:59 +01:00
parent 78dcdbc246
commit 0081a96cbc

View File

@ -2089,6 +2089,7 @@ gtk_paned_state_flags_changed (GtkWidget *widget,
else
cursor = NULL;
if (priv->handle)
gdk_window_set_cursor (priv->handle, cursor);
if (cursor)