mesa: Use array object constructor.
authorMathias Fröhlich <Mathias.Froehlich@web.de>
Wed, 2 Nov 2011 18:54:26 +0000 (19:54 +0100)
committerMathias Fröhlich <Mathias.Froehlich@gmx.net>
Wed, 18 Apr 2012 17:51:16 +0000 (19:51 +0200)
This change uses the array object factory for gl_array_objects. This
prevents crashes when deriving from gl_array_object.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
src/mesa/main/context.c
src/mesa/main/varray.c

index 51b024143adc07f50258ec09b74a971b69905bf6..a506981b45149f4045de390ce835295038e37ae0 100644 (file)
@@ -1118,7 +1118,8 @@ _mesa_free_context_data( struct gl_context *ctx )
    _mesa_free_varray_data(ctx);
    _mesa_free_transform_feedback(ctx);
 
-   _mesa_delete_array_object(ctx, ctx->Array.DefaultArrayObj);
+   _mesa_reference_array_object(ctx, &ctx->Array.ArrayObj, NULL);
+   _mesa_reference_array_object(ctx, &ctx->Array.DefaultArrayObj, NULL);
 
 #if FEATURE_ARB_pixel_buffer_object
    _mesa_reference_buffer_object(ctx, &ctx->Pack.BufferObj, NULL);
index a402c7b22dc7e4e9605df1153def053ae93231db..1c1484323bbad07ddfbee0f7a0a33e17eb52e77f 100644 (file)
@@ -1221,7 +1221,7 @@ _mesa_print_arrays(struct gl_context *ctx)
 void 
 _mesa_init_varray(struct gl_context *ctx)
 {
-   ctx->Array.DefaultArrayObj = _mesa_new_array_object(ctx, 0);
+   ctx->Array.DefaultArrayObj = ctx->Driver.NewArrayObject(ctx, 0);
    _mesa_reference_array_object(ctx, &ctx->Array.ArrayObj,
                                 ctx->Array.DefaultArrayObj);
    ctx->Array.ActiveTexture = 0;   /* GL_ARB_multitexture */