From 4628d28172b2ec1cb6ef160d11f05863bcd5bd50 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Mon, 6 Sep 2010 17:18:11 +0100 Subject: [PATCH] cogl-framebuffer: Clear the renderbuffer list on failure When try_creating_fbo fails it deletes any intermediate render buffers that were created. However it doesn't clear the list so I think if it failed a second time it would try to delete the render buffers again. This could potentially cause problems if a subsequent fbo is created because the destructor for the original might delete the renderbuffers of the new fbo. --- cogl/cogl-framebuffer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c index 2a38c552a..ea9376e71 100644 --- a/cogl/cogl-framebuffer.c +++ b/cogl/cogl-framebuffer.c @@ -432,6 +432,10 @@ try_creating_fbo (CoglOffscreen *offscreen, GLuint renderbuffer = GPOINTER_TO_UINT (l->data); GE (glDeleteRenderbuffers (1, &renderbuffer)); } + + g_slist_free (offscreen->renderbuffers); + offscreen->renderbuffers = NULL; + return FALSE; }