summaryrefslogtreecommitdiff
path: root/src/mesa/main/framebuffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/framebuffer.c')
-rw-r--r--src/mesa/main/framebuffer.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
index c9b30d3252..0a6de12fb8 100644
--- a/src/mesa/main/framebuffer.c
+++ b/src/mesa/main/framebuffer.c
@@ -38,6 +38,7 @@
#include "fbobject.h"
#include "framebuffer.h"
#include "renderbuffer.h"
+#include "texobj.h"
@@ -192,17 +193,11 @@ _mesa_free_framebuffer_data(struct gl_framebuffer *fb)
_mesa_reference_renderbuffer(&att->Renderbuffer, NULL);
}
if (att->Texture) {
- /* render to texture */
- att->Texture->RefCount--;
- if (att->Texture->RefCount == 0) {
- GET_CURRENT_CONTEXT(ctx);
- if (ctx) {
- ctx->Driver.DeleteTexture(ctx, att->Texture);
- }
- }
+ _mesa_reference_texobj(&att->Texture, NULL);
}
+ ASSERT(!att->Renderbuffer);
+ ASSERT(!att->Texture);
att->Type = GL_NONE;
- att->Texture = NULL;
}
/* unbind _Depth/_StencilBuffer to decr ref counts */