[Wayland-bugs] [Bug 761312] memory leak

gtk+ (GNOME Bugzilla) bugzilla at gnome.org
Thu Feb 4 16:06:31 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=761312

--- Comment #53 from Jonas Ã…dahl <jadahl at gmail.com> ---
Review of attachment 320366:

::: gdk/wayland/gdkwindow-wayland.c
@@ +671,3 @@
+   * the old committed buffer again.
+   */
+  impl->staging_cairo_surface = g_steal_pointer
(&impl->committed_cairo_surface);

Looks like we'll leak GdkWindowImplWayland and the released buffer here if the
window was already destroyed before wl_buffer.release was received. The
triggering flow:

1. draw into and attach+commit wl_buffer at 123 (committed = wl_buffer at 123,
staging == NULL, window ref = 2)
2. destroy window (window ref = 1, last ref held by wl_buffer at 123, committed =
wl_buffer at 123)
3. wl_buffer at 123.release (committed = NULL, staging = wl_buffer at 123, window_ref
= 1)

What is the benefit of not just detaching buffers/cairo-surfaces on window
destruction? We'd leak them either way if we disconnect from the server since
we won't get any release events, and to fix that we need a per display
connection list of cairo surfaces that needs to be explicitly destroyed on
disconnect, and having a circular reference (impl -> cairo surface -> impl)
doesn't seem to help with that.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-bugs/attachments/20160204/e0cb4940/attachment.html>


More information about the wayland-bugs mailing list