meta/generate_mipmap: Don't leak the framebuffer object
authorIan Romanick <ian.d.romanick@intel.com>
Sat, 14 Nov 2015 00:09:37 +0000 (16:09 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 18 Nov 2015 17:38:21 +0000 (09:38 -0800)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
src/mesa/drivers/common/meta_generate_mipmap.c

index ffd71b6a199f42a98490f6f29eba4d153f2bdc4b..bde170fcf6fb4213ea53a75901f8e292d0e12ea2 100644 (file)
@@ -131,6 +131,11 @@ _mesa_meta_glsl_generate_mipmap_cleanup(struct gen_mipmap_state *mipmap)
    _mesa_DeleteSamplers(1, &mipmap->Sampler);
    mipmap->Sampler = 0;
 
+   if (mipmap->FBO != 0) {
+      _mesa_DeleteFramebuffers(1, &mipmap->FBO);
+      mipmap->FBO = 0;
+   }
+
    _mesa_meta_blit_shader_table_cleanup(&mipmap->shaders);
 }