[gtk/gtk-3-24: 1/2] Prevent Gtk-CRITICAL when unrealize-ing a GtkPaned.



commit 0081a96cbcd554b81af8263dad5e41de7073cd6b
Author: Reuben Green <reubengreen73 gmail com>
Date:   Tue Jul 30 18:50:59 2019 +0100

    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

 gtk/gtkpaned.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c
index 7e215228a8..4d44a0729d 100644
--- a/gtk/gtkpaned.c
+++ b/gtk/gtkpaned.c
@@ -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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]