GNOME Bugzilla – Bug 60857
antiexpose memory leak
Last modified: 2011-02-04 16:16:03 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?
Created attachment 5726 [details] [review] This patch fixes the problem, but is it correct?
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.
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.
Move open bugs from milestones 2.0.[012] -- > 2.0.3, since 2.0.2 is already out.
Moving a number of non-critical or hard-to-fix bugs to 2.2.0
This is a WONTFIX, in my opinion, because trying to release all allocated memory on exit is futile anyway.
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.
Created attachment 24004 [details] [review] Patch
Looks fine to commit (head only)
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.