mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 22:10:08 +00:00
gtkwidget: Do a type-check in gtk_widget_in_destruction()
Given it can be called during a widget destruction, it's safer to do a type-check before crashing. See: https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1727
This commit is contained in:
parent
634bea777f
commit
07197a299f
@ -10638,7 +10638,11 @@ gtk_widget_set_has_focus (GtkWidget *widget,
|
||||
gboolean
|
||||
gtk_widget_in_destruction (GtkWidget *widget)
|
||||
{
|
||||
GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
|
||||
GtkWidgetPrivate *priv;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
|
||||
|
||||
priv = gtk_widget_get_instance_private (widget);
|
||||
|
||||
return priv->in_destruction;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user