From 5786d074509212ec926a9a595d54af8add4ee832 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 25 Sep 2015 10:02:54 +0200 Subject: vo_opengl: vaapi: fix cleanup Don't call eglDestroyImageKHR() on the same ID possibly more than once. Clear the image reference on termination, or we would leak up to 1 image per VO recreation. --- video/out/opengl/hwdec_vaegl.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'video') diff --git a/video/out/opengl/hwdec_vaegl.c b/video/out/opengl/hwdec_vaegl.c index b084d7203d..33d8972b0a 100644 --- a/video/out/opengl/hwdec_vaegl.c +++ b/video/out/opengl/hwdec_vaegl.c @@ -50,6 +50,7 @@ static void unref_image(struct gl_hwdec *hw) for (int n = 0; n < 4; n++) { if (p->images[n]) hw->gl->DestroyImageKHR(eglGetCurrentDisplay(), p->images[n]); + p->images[n] = 0; } va_lock(p->ctx); @@ -83,6 +84,7 @@ static void destroy_textures(struct gl_hwdec *hw) static void destroy(struct gl_hwdec *hw) { struct priv *p = hw->priv; + unref_image(hw); destroy_textures(hw); va_destroy(p->ctx); } -- cgit v1.2.3