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:
@ -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,
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user