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:
parent
78dcdbc246
commit
0081a96cbc
@ -2089,7 +2089,8 @@ gtk_paned_state_flags_changed (GtkWidget *widget,
|
||||
else
|
||||
cursor = NULL;
|
||||
|
||||
gdk_window_set_cursor (priv->handle, cursor);
|
||||
if (priv->handle)
|
||||
gdk_window_set_cursor (priv->handle, cursor);
|
||||
|
||||
if (cursor)
|
||||
g_object_unref (cursor);
|
||||
|
Loading…
Reference in New Issue
Block a user