mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-18 07:30:08 +00:00
GtkWindow: use a weak ref to keep track of attach_widget
Taking a full reference of the attach widget creates a reference cycle, and keeps the attach_widget alive longer than it should.
This commit is contained in:
parent
f326c0eac8
commit
fb08a26acd
@ -2510,7 +2510,7 @@ remove_attach_widget (GtkWindow *window)
|
||||
{
|
||||
_gtk_widget_remove_attached_window (priv->attach_widget, window);
|
||||
|
||||
g_object_unref (priv->attach_widget);
|
||||
g_object_remove_weak_pointer (priv->attach_widget, &priv->attach_widget);
|
||||
priv->attach_widget = NULL;
|
||||
}
|
||||
}
|
||||
@ -2760,7 +2760,7 @@ gtk_window_set_attached_to (GtkWindow *window,
|
||||
{
|
||||
_gtk_widget_add_attached_window (priv->attach_widget, window);
|
||||
|
||||
g_object_ref (priv->attach_widget);
|
||||
g_object_add_weak_pointer (priv->attach_widget, &priv->attach_widget);
|
||||
}
|
||||
|
||||
/* Update the style, as the widget path might change. */
|
||||
|
Loading…
Reference in New Issue
Block a user