gallium: free renderbuffer's old texture in st_renderbuffer_alloc_storage()
authorBrian Paul <brian.paul@tungstengraphics.com>
Mon, 26 May 2008 19:35:29 +0000 (13:35 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Mon, 26 May 2008 19:35:29 +0000 (13:35 -0600)
src/mesa/state_tracker/st_cb_fbo.c

index 3560a040c859a53af5fc68df6bdc27acee93766b..76145a4d5c4f925a202fec20281d76e47e2b2d34 100644 (file)
@@ -92,10 +92,11 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
    struct pipe_texture template;
    unsigned surface_usage;
 
-   /* Free the old surface (and texture if we hold the last
-    * reference):
+   /* Free the old surface and texture
     */
    pipe_surface_reference( &strb->surface, NULL );
+   pipe_texture_reference( &strb->texture, NULL );
+
 
    memset(&template, 0, sizeof(template));