summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2014-09-16 18:11:34 (GMT)
committerJasper St. Pierre <jstpierre@mecheye.net>2014-09-16 18:12:21 (GMT)
commit1de740955f82ba6b3b3c0385f0d88106b7a6c9ac (patch)
tree8ef52c8483f807d6f713ace74bdfd10f6c7b6471
parent21f123c69fadd5d117829255ca28bc4a8051fb72 (diff)
downloadmutter-1de740955f82ba6b3b3c0385f0d88106b7a6c9ac.zip
mutter-1de740955f82ba6b3b3c0385f0d88106b7a6c9ac.tar.xz
wayland: Don't leak the existing texture if we already have one
We were missing a check in ensure_buffer_texture that checked if we already had a CoglTexture bound for the buffer.
-rw-r--r--src/wayland/meta-wayland-surface.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index 771154a..c231b41 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -151,6 +151,9 @@ ensure_buffer_texture (MetaWaylandBuffer *buffer)
CoglError *catch_error = NULL;
CoglTexture *texture;
+ if (buffer->texture)
+ return;
+
texture = COGL_TEXTURE (cogl_wayland_texture_2d_new_from_buffer (ctx,
buffer->resource,
&catch_error));