[Mesa-dev] [PATCH] mesa: move unrefs of array objects earlier in _mesa_free_context_data()

Jose Fonseca jfonseca at vmware.com
Thu Apr 19 09:12:56 PDT 2012


Seems good to me.

Joe

----- Original Message -----
> If a non-default array object was bound at context destruction time
> we'd try to unreference the array object after it was already deleted
> in _mesa_free_varray_data().  Now do the unref first.
> 
> Fixes a regression from commit
> 86f53e6d6bd07e2bc3ffcadeb9a4418fbae06e0b.
> ---
>  src/mesa/main/context.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
> index a506981..d75351c 100644
> --- a/src/mesa/main/context.c
> +++ b/src/mesa/main/context.c
> @@ -1104,6 +1104,9 @@ _mesa_free_context_data( struct gl_context *ctx
> )
>     _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current,
>     NULL);
>     _mesa_reference_fragprog(ctx,
>     &ctx->FragmentProgram._TexEnvProgram, NULL);
>  
> +   _mesa_reference_array_object(ctx, &ctx->Array.ArrayObj, NULL);
> +   _mesa_reference_array_object(ctx, &ctx->Array.DefaultArrayObj,
> NULL);
> +
>     _mesa_free_attrib_data(ctx);
>     _mesa_free_buffer_objects(ctx);
>     _mesa_free_lighting_data( ctx );
> @@ -1118,9 +1121,6 @@ _mesa_free_context_data( struct gl_context *ctx
> )
>     _mesa_free_varray_data(ctx);
>     _mesa_free_transform_feedback(ctx);
>  
> -   _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);
>     _mesa_reference_buffer_object(ctx, &ctx->Unpack.BufferObj, NULL);
> --
> 1.7.3.4
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 


More information about the mesa-dev mailing list