diff options
author | Matthias Clasen <mclasen@redhat.com> | 2013-05-02 08:01:14 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2013-05-02 08:01:14 -0400 |
commit | fb08a26acdb5aff94e3a33997a030147109b001c (patch) | |
tree | 6d40585d5df745a4afe291490eac041b16a31519 | |
parent | f326c0eac806b037c7100309887ffc5f9193070d (diff) | |
download | gtk+-fb08a26acdb5aff94e3a33997a030147109b001c.tar.gz |
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.
-rw-r--r-- | gtk/gtkwindow.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 16942b8ab3..b6e3e15964 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -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. */ |