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 60857 - antiexpose memory leak
antiexpose memory leak
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: X11
1.3.x
Other Linux
: Low enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2001-09-21 01:43 UTC by Joshua N Pritikin
Modified: 2011-02-04 16:16 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
This patch fixes the problem, but is it correct? (3.28 KB, patch)
2001-09-28 17:50 UTC, Joshua N Pritikin
none Details | Review
Patch (1.05 KB, patch)
2004-02-02 22:21 UTC, Soren Sandmann Pedersen
none Details | Review

Description Joshua N Pritikin 2001-09-21 01:43:11 UTC
While tracking down memory leaks, i found something curious.

If there are any antiexpose records queued (by
_gdk_windowing_window_queue_antiexpose) when the GdkWindow is destroyed
then they will leak and cause the GdkWindow to leak.  i believe the
translate_queue needs to be filtered upon gdk_window_destroy.

If this is the correct fix then i can provide a patch.  Am i missing something?
Comment 1 Joshua N Pritikin 2001-09-28 17:50:41 UTC
Created attachment 5726 [details] [review]
This patch fixes the problem, but is it correct?
Comment 2 Owen Taylor 2001-10-18 19:17:39 UTC
Actually, as more exposes come in the items will be removed
from the anti-expose queue. So, the only advantage of
such a patch would be making "objects left on exit"
look more reasonable at the expense of slower deletion
of windows.
Comment 3 Joshua N Pritikin 2001-10-18 20:17:50 UTC
i can't believe the overhead is significant, but maybe it is.  All i
really want is a way to debug memory leaks.  If you want to adapt the
behavior to whether GRUNTIME_DEBUG=objects is set then that is fine too.
Comment 4 Matthias Clasen 2002-04-05 13:34:51 UTC
Move open bugs from milestones 2.0.[012] -- > 2.0.3, since 2.0.2 is already out.
Comment 5 Owen Taylor 2002-06-12 21:59:57 UTC
Moving a number of non-critical or hard-to-fix bugs to 2.2.0
Comment 6 Soren Sandmann Pedersen 2003-12-07 19:15:04 UTC
This is a WONTFIX, in my opinion, because trying to release all
allocated memory on exit is futile anyway.
Comment 7 Owen Taylor 2003-12-09 23:14:14 UTC
The right way is to use 
g_object_add_weak_pointer()/g_object_remove_weak_pointer()
rather than g_object_ref()/g_object_unref().

I think it's worth making the change; it's just ugly to have
dead windows being kept alive by the antiexpose queue.


Comment 8 Soren Sandmann Pedersen 2004-02-02 22:21:52 UTC
Created attachment 24004 [details] [review]
Patch
Comment 9 Owen Taylor 2004-02-02 22:49:56 UTC
Looks fine to commit (head only)
Comment 10 Soren Sandmann Pedersen 2004-02-02 23:21:45 UTC
Tue Feb  3 00:14:36 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gdk/x11/gdkgeometry-x11.c (queue_item_free, gdk_window_queue):
	Use a weak reference instead of ref()/unref(). (#60857, reported
	by Joshua N Pritikin)

	* gdk/gdkimage.c (scratch_image_info_for_depth): Formatting fix.