From b8ceaaa42f3fafb41df9eff2ce94fb5c13ebdb55 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Tue, 19 Jun 2012 15:41:12 -0400 Subject: [PATCH] compositor: Destroy EGLImage and texture when a NULL buffer is attached --- src/compositor.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/compositor.c b/src/compositor.c index 73fed3e..00b8f3e 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -711,6 +711,14 @@ weston_surface_attach(struct wl_surface *surface, struct wl_buffer *buffer) if (!buffer) { if (weston_surface_is_mapped(es)) weston_surface_unmap(es); + if (es->image != EGL_NO_IMAGE_KHR) { + ec->destroy_image(ec->egl_display, es->image); + es->image = NULL; + } + if (es->texture) { + glDeleteTextures(1, &es->texture); + es->texture = 0; + } return; } -- 2.7.4