don't alloc region in xmesa_surface_alloc(), fixes a mem leak
authorBrian <brian.paul@tungstengraphics.com>
Fri, 19 Oct 2007 18:42:05 +0000 (12:42 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Fri, 19 Oct 2007 18:42:05 +0000 (12:42 -0600)
src/mesa/drivers/x11/xm_surface.c

index 86fecdb2f7cd5209ba198b7d5a6d9caafe118d91..8d2c2ca5f38b94630b7d52507fa36fe407a3fcdd 100644 (file)
@@ -284,6 +284,7 @@ xmesa_surface_alloc(struct pipe_context *pipe, GLuint pipeFormat)
 {
    struct xmesa_surface *xms = CALLOC_STRUCT(xmesa_surface);
 
+   assert(pipe);
    assert(pipeFormat);
 
    xms->surface.surface.format = pipeFormat;
@@ -293,9 +294,6 @@ xmesa_surface_alloc(struct pipe_context *pipe, GLuint pipeFormat)
     */
    softpipe_init_surface_funcs(&xms->surface);
 
-   assert(pipe);
-   xms->surface.surface.region = pipe->region_alloc(pipe, 1, 1, 1, 0x0);
-
    return &xms->surface.surface;
 }