window: destroy surfaces on display_destroy()

Destroy the window decoration surfaces and pointer surfaces.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
This commit is contained in:
Pekka Paalanen 2011-12-19 10:31:45 +02:00
parent e1207c708e
commit 325bb60792

View File

@ -697,6 +697,19 @@ create_pointer_surfaces(struct display *display)
}
static void
destroy_pointer_surfaces(struct display *display)
{
int i, count;
count = ARRAY_LENGTH(pointer_images);
for (i = 0; i < count; ++i) {
if (display->pointer_surfaces[i])
cairo_surface_destroy(display->pointer_surfaces[i]);
}
free(display->pointer_surfaces);
}
cairo_surface_t *
display_get_pointer_surface(struct display *display, int pointer,
int *width, int *height,
@ -2663,6 +2676,12 @@ display_destroy(struct display *display)
display_destroy_inputs(display);
fini_xkb(display);
cairo_surface_destroy(display->active_frame);
cairo_surface_destroy(display->inactive_frame);
cairo_surface_destroy(display->shadow);
destroy_pointer_surfaces(display);
fini_egl(display);
if (display->shell)