summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2001-03-26 20:54:17 +0000
committerOwen Taylor <otaylor@src.gnome.org>2001-03-26 20:54:17 +0000
commit2c613ffd95fd25dceea8173271f3fbc488321cd9 (patch)
treee44f8e8c1ac30bcf7a3374397395482de7b79c85
parentcf41369b5b0f7898cb9c49a35dfb8febd7aef364 (diff)
downloadgdk-pixbuf-2c613ffd95fd25dceea8173271f3fbc488321cd9.tar.gz
Don't reference the widgets in the resulting list. (#11821) This makes
Mon Mar 26 15:48:45 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtkwindow.c (gtk_window_list_toplevels): Don't reference the widgets in the resulting list. (#11821) This makes this consistent with gtk_container_children. * gtk/gtkwindow.c gtk/gtkwidget.c: Fix up the two uses of gtk_window_list_toplevels.
-rw-r--r--ChangeLog9
-rw-r--r--ChangeLog.pre-2-09
-rw-r--r--ChangeLog.pre-2-109
-rw-r--r--ChangeLog.pre-2-29
-rw-r--r--ChangeLog.pre-2-49
-rw-r--r--ChangeLog.pre-2-69
-rw-r--r--ChangeLog.pre-2-89
-rw-r--r--gtk/gtkwidget.c3
-rw-r--r--gtk/gtkwindow.c14
9 files changed, 74 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 15dc1b841..22114f22c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Mon Mar 26 15:48:45 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkwindow.c (gtk_window_list_toplevels): Don't
+ reference the widgets in the resulting list. (#11821)
+ This makes this consistent with gtk_container_children.
+
+ * gtk/gtkwindow.c gtk/gtkwidget.c: Fix up the two
+ uses of gtk_window_list_toplevels.
+
Mon Mar 26 15:26:17 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c (gtk_im_context_set_use_preedit): Add
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index 15dc1b841..22114f22c 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -1,3 +1,12 @@
+Mon Mar 26 15:48:45 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkwindow.c (gtk_window_list_toplevels): Don't
+ reference the widgets in the resulting list. (#11821)
+ This makes this consistent with gtk_container_children.
+
+ * gtk/gtkwindow.c gtk/gtkwidget.c: Fix up the two
+ uses of gtk_window_list_toplevels.
+
Mon Mar 26 15:26:17 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c (gtk_im_context_set_use_preedit): Add
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 15dc1b841..22114f22c 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,12 @@
+Mon Mar 26 15:48:45 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkwindow.c (gtk_window_list_toplevels): Don't
+ reference the widgets in the resulting list. (#11821)
+ This makes this consistent with gtk_container_children.
+
+ * gtk/gtkwindow.c gtk/gtkwidget.c: Fix up the two
+ uses of gtk_window_list_toplevels.
+
Mon Mar 26 15:26:17 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c (gtk_im_context_set_use_preedit): Add
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index 15dc1b841..22114f22c 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,12 @@
+Mon Mar 26 15:48:45 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkwindow.c (gtk_window_list_toplevels): Don't
+ reference the widgets in the resulting list. (#11821)
+ This makes this consistent with gtk_container_children.
+
+ * gtk/gtkwindow.c gtk/gtkwidget.c: Fix up the two
+ uses of gtk_window_list_toplevels.
+
Mon Mar 26 15:26:17 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c (gtk_im_context_set_use_preedit): Add
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index 15dc1b841..22114f22c 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,12 @@
+Mon Mar 26 15:48:45 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkwindow.c (gtk_window_list_toplevels): Don't
+ reference the widgets in the resulting list. (#11821)
+ This makes this consistent with gtk_container_children.
+
+ * gtk/gtkwindow.c gtk/gtkwidget.c: Fix up the two
+ uses of gtk_window_list_toplevels.
+
Mon Mar 26 15:26:17 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c (gtk_im_context_set_use_preedit): Add
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index 15dc1b841..22114f22c 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,12 @@
+Mon Mar 26 15:48:45 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkwindow.c (gtk_window_list_toplevels): Don't
+ reference the widgets in the resulting list. (#11821)
+ This makes this consistent with gtk_container_children.
+
+ * gtk/gtkwindow.c gtk/gtkwidget.c: Fix up the two
+ uses of gtk_window_list_toplevels.
+
Mon Mar 26 15:26:17 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c (gtk_im_context_set_use_preedit): Add
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index 15dc1b841..22114f22c 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,12 @@
+Mon Mar 26 15:48:45 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkwindow.c (gtk_window_list_toplevels): Don't
+ reference the widgets in the resulting list. (#11821)
+ This makes this consistent with gtk_container_children.
+
+ * gtk/gtkwindow.c gtk/gtkwidget.c: Fix up the two
+ uses of gtk_window_list_toplevels.
+
Mon Mar 26 15:26:17 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c (gtk_im_context_set_use_preedit): Add
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 52cf619ad..7b95943ec 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -4630,6 +4630,8 @@ gtk_widget_set_default_direction (GtkTextDirection dir)
gtk_default_direction = dir;
tmp_list = toplevels = gtk_window_list_toplevels ();
+ g_list_foreach (toplevels, (GFunc)g_object_ref, NULL);
+
while (tmp_list)
{
gtk_widget_set_default_direction_recurse (tmp_list->data,
@@ -4639,7 +4641,6 @@ gtk_widget_set_default_direction (GtkTextDirection dir)
}
g_list_free (toplevels);
-
}
}
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index a61ca7741..58448226d 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -1020,11 +1020,14 @@ gtk_window_set_modal (GtkWindow *window,
/**
* gtk_window_list_toplevels:
*
- * Returns a list of all existing toplevel windows. Each widget
- * in the list has a reference added to it; to free the
- * list, first unref each widget in the list, then free the list.
+ * Returns a list of all existing toplevel windows. The widgets
+ * in the list are not individually referenced. If you want
+ * to iterate through the list and perform actions involving
+ * callbacks that might destroy the widgets, you MUST call
+ * g_list_foreach (result, (GFunc)g_object_ref, NULL) first, and
+ * then unref all the widgets afterwards.
*
- * Return value: list of referenced toplevel widgets
+ * Return value: list of toplevel widgets
**/
GList*
gtk_window_list_toplevels (void)
@@ -1033,7 +1036,7 @@ gtk_window_list_toplevels (void)
GSList *slist;
for (slist = toplevel_list; slist; slist = slist->next)
- list = g_list_prepend (list, gtk_widget_ref (slist->data));
+ list = g_list_prepend (list, slist->data);
return list;
}
@@ -2286,6 +2289,7 @@ gtk_window_read_rcfiles (GtkWidget *widget,
_gtk_icon_set_invalidate_caches ();
toplevels = gtk_window_list_toplevels ();
+ g_list_foreach (toplevels, (GFunc)g_object_ref, NULL);
for (list = toplevels; list; list = list->next)
{