From 01d7e3d5a25a7cc49b38f5561d00c2ff22c43e93 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 9 Feb 2010 14:25:41 +0100 Subject: mesa: Enable true refcounting for NullBufferObj. This object can be shared with another context, so we cannot just delete it when the owning context is being destroyed. Ensuring that buffer objects are properly refcounted guarantees NullBufferObj is destroyed when all references to it are removed. --- src/mesa/main/context.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mesa/main/context.c') diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index fccce51e85..591aa1121d 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -955,6 +955,7 @@ _mesa_free_context_data( GLcontext *ctx ) _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram, NULL); _mesa_free_attrib_data(ctx); + _mesa_free_buffer_objects(ctx); _mesa_free_lighting_data( ctx ); _mesa_free_eval_data( ctx ); _mesa_free_texture_data( ctx ); @@ -974,6 +975,7 @@ _mesa_free_context_data( GLcontext *ctx ) #if FEATURE_ARB_pixel_buffer_object _mesa_reference_buffer_object(ctx, &ctx->Pack.BufferObj, NULL); _mesa_reference_buffer_object(ctx, &ctx->Unpack.BufferObj, NULL); + _mesa_reference_buffer_object(ctx, &ctx->DefaultPacking.BufferObj, NULL); #endif #if FEATURE_ARB_vertex_buffer_object -- cgit v1.2.3