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 85719 - gdk_window_destroy() docs
gdk_window_destroy() docs
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Documentation
2.0.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2002-06-17 22:29 UTC by Owen Taylor
Modified: 2011-02-04 16:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
better description for gdk_window_destroy() (1.16 KB, patch)
2002-10-12 14:52 UTC, Soren Sandmann Pedersen
none Details | Review

Description Owen Taylor 2002-06-17 22:29:10 UTC
The docs for gdk_window_destroy() are very wrong:

/**
 * gdk_window_destroy:
 * @window: a #GdkWindow
 *
 * Destroys @window (destroys the server-side resource associated with
 * @window).  Memory allocated for @window may not be freed until all
 * references to @window are dropped. All children of @window are also
 * destroyed.
 *
 * There's normally no need to use this function, window are automatically
 * destroyed when their reference count reaches 0.
 */

A) gdk_window_destroy() has all sorts of visible side effects.

B) GDK actually warns if you unref a window to zero without destroying it.

  if (!GDK_WINDOW_DESTROYED (window))
    {
      if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN)
	{
	  g_warning ("losing last reference to undestroyed window\n");
	  _gdk_window_destroy (window, FALSE);
	}
      [...]
    }
Comment 1 Soren Sandmann Pedersen 2002-10-12 14:52:00 UTC
Created attachment 11506 [details] [review]
better description for gdk_window_destroy()
Comment 2 Soren Sandmann Pedersen 2002-10-12 14:52:35 UTC
Does this look right?
Comment 3 Owen Taylor 2002-10-13 15:41:57 UTC
Looks basically good. I might say, instead of:

 "All children of @window are also destroyed"

 "The window system resources for all children of @window
  are also destroyed"

Since "destroy" by itself is rather ambiguous.
Comment 4 Soren Sandmann Pedersen 2002-10-13 17:17:42 UTC
Committed with that change.