free Default1D/2DArray objects
authorBrian <brian.paul@tungstengraphics.com>
Tue, 25 Dec 2007 00:37:30 +0000 (17:37 -0700)
committerBrian <brian.paul@tungstengraphics.com>
Tue, 1 Jan 2008 17:21:20 +0000 (10:21 -0700)
src/mesa/main/context.c

index 563a89e686981808239509c206068e100fde1725..a9f9bd9da4458aa345fd45a41a8a462356c0cb12 100644 (file)
@@ -554,8 +554,13 @@ alloc_shared_state( GLcontext *ctx )
       (*ctx->Driver.DeleteTexture)(ctx, ss->DefaultCubeMap);
    if (ss->DefaultRect)
       (*ctx->Driver.DeleteTexture)(ctx, ss->DefaultRect);
-   if (ss)
-      _mesa_free(ss);
+   if (ss->Default1DArray)
+      (*ctx->Driver.DeleteTexture)(ctx, ss->Default1DArray);
+   if (ss->Default2DArray)
+      (*ctx->Driver.DeleteTexture)(ctx, ss->Default2DArray);
+
+   _mesa_free(ss);
+
    return GL_FALSE;
 }
 
@@ -678,6 +683,9 @@ free_shared_state( GLcontext *ctx, struct gl_shared_state *ss )
    ctx->Driver.DeleteTexture(ctx, ss->Default3D);
    ctx->Driver.DeleteTexture(ctx, ss->DefaultCubeMap);
    ctx->Driver.DeleteTexture(ctx, ss->DefaultRect);
+   ctx->Driver.DeleteTexture(ctx, ss->Default1DArray);
+   ctx->Driver.DeleteTexture(ctx, ss->Default2DArray);
+
    /* all other textures */
    _mesa_HashDeleteAll(ss->TexObjects, delete_texture_cb, ctx);
    _mesa_DeleteHashTable(ss->TexObjects);