From: Mathias Fröhlich Date: Wed, 2 Nov 2011 18:54:26 +0000 (+0100) Subject: mesa: Use array object constructor. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=86f53e6d6bd07e2bc3ffcadeb9a4418fbae06e0b;p=mesa.git mesa: Use array object constructor. This change uses the array object factory for gl_array_objects. This prevents crashes when deriving from gl_array_object. Reviewed-by: Brian Paul Signed-off-by: Mathias Froehlich --- diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 51b024143ad..a506981b451 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -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); diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index a402c7b22dc..1c1484323bb 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -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 */