mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-14 06:10:21 +00:00
widget: Take a ref during ::unrealize emission
In order to prevent invalid memory access/crashes if the widget is destroyed in a callback of that signal. https://bugzilla.gnome.org/show_bug.cgi?id=745829
This commit is contained in:
parent
f5f6ad9981
commit
b4e61b759b
@ -5566,6 +5566,7 @@ gtk_widget_unrealize (GtkWidget *widget)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_WIDGET (widget));
|
||||
|
||||
g_object_ref (widget);
|
||||
gtk_widget_push_verify_invariants (widget);
|
||||
|
||||
if (widget->priv->has_shape_mask)
|
||||
@ -5592,6 +5593,7 @@ gtk_widget_unrealize (GtkWidget *widget)
|
||||
}
|
||||
|
||||
gtk_widget_pop_verify_invariants (widget);
|
||||
g_object_unref (widget);
|
||||
}
|
||||
|
||||
/*****************************************
|
||||
|
Loading…
Reference in New Issue
Block a user