After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 11821 - gtk_window_list_toplevels() is inconsistent
gtk_window_list_toplevels() is inconsistent
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
1.3.x
Other other
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2000-05-22 22:20 UTC by Havoc Pennington
Modified: 2011-02-04 16:09 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Havoc Pennington 2001-01-27 19:48:01 UTC
Package: gtk+
Version: 1.3

It's nonstandard in GTK to reference returned objects (a good thing,
since CORBA/Mozilla have both experienced tons of memleaks with the
other policy), list_toplevels() should IMO be consistent with
container_get_children() and with all the functions that return a
single object.

Havoc




------- Bug moved to this database by debbugs-export@bugzilla.gnome.org 2001-01-27 14:48 -------
This bug was previously known as bug 11821 at http://bugs.gnome.org/
http://bugs.gnome.org/show_bug.cgi?id=11821
Originally filed under the gtk+ product and general component.

Reassigning to the default owner of the component, gtk-bugs@gtk.org.

Comment 1 Havoc Pennington 2001-01-27 22:02:41 UTC
I feel like we probably discussed this a while ago, someone should
find the discussion and link it here.
Comment 2 Havoc Pennington 2001-01-29 19:40:12 UTC
Put all GTK 1.3.x bugs on 2.0.0 milestone
Comment 3 Havoc Pennington 2001-01-29 19:49:57 UTC
Setting API-affecting bugs to the API freeze milestone
Comment 4 Havoc Pennington 2001-02-28 00:22:33 UTC
Tim is this OK to fix? You and Owen need to work this out.
Comment 5 Alexander Larsson 2001-02-28 13:51:54 UTC
I tried to find the discussion, but couldn't find it.
Comment 6 Havoc Pennington 2001-03-01 16:07:07 UTC
Tim says: well, then make gtk_window_list_toplevels() a private function
by prefixing it with "_" and provide a public non-refing variant
thereof.
Comment 7 Owen Taylor 2001-03-26 20:54:08 UTC
Made following change:

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.

I didn't add the internal function, since it seemed like
a silly hyper-optimization. Neither use of gtk_window_list_toplevels()
is at all time critical, and the duplicated code is tiny.