wayland: Plug surface leak

Other backends take care of the cairo surface destruction in
GdkWindow::destroy. We must do the same here, or the cairo_surface
and its corresponding wl_buffer are left dangling.

https://bugzilla.gnome.org/show_bug.cgi?id=747295
This commit is contained in:
Carlos Garnacho
2015-11-24 17:41:58 +01:00
parent 0ff879e975
commit d62febcf97
2 changed files with 9 additions and 1 deletions

View File

@ -1029,6 +1029,8 @@ gdk_wayland_cairo_surface_destroy (void *p)
{
GdkWaylandCairoSurfaceData *data = p;
g_print ("EHMMMM...\n");
if (data->buffer)
wl_buffer_destroy (data->buffer);
@ -1056,6 +1058,8 @@ _gdk_wayland_display_create_shm_surface (GdkWaylandDisplay *display,
data->scale = scale;
data->busy = FALSE;
g_print ("create shm surface...\n");
stride = width * 4;
data->pool = create_shm_pool (display->shm,

View File

@ -1769,7 +1769,11 @@ gdk_wayland_window_destroy (GdkWindow *window,
gdk_wayland_window_hide_surface (window);
if (impl->cairo_surface)
cairo_surface_finish (impl->cairo_surface);
{
cairo_surface_finish (impl->cairo_surface);
cairo_surface_destroy (impl->cairo_surface);
impl->cairo_surface = NULL;
}
}
static void